C++ Fast please Write a program in C++ using templates to create a generic function with the name area with two arguments, which receives either integer or float data types. The generic function evaluates the following algebraic expressions. =x²-2xy + y² Print the value of variable c. Sample output 1: Enter two numbers: 2 3.5 area of numbers 2 and 3.5 1s: 2.25 Enter two numbers: 2.5 3 area of numbers 2.5 and 3 1s: 0.25 Enter two numbers: 2 1.5 area of numbers 2 and 1.5 1s: 0.25 Enter two numbers: 1.5 3 area of numbers 1.5 and 3 1s: 2.25

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.5: Case Studies
Problem 3E
icon
Related questions
icon
Concept explainers
Question
C++
Fast please
Write a program in C++ using templates to create a generic function with the name area with two arguments, which receives either
integer or float data types. The generic function evaluates the following algebraic expressions.
= 2² - 2xy + y²
Print the value of variable c.
Sample output 1:
Enter two numbers:
2.3.5
area of numbers 2 and 3.5 is: 2.25
Enter two numbers:
2.5 3
area of numbers 2.5 and 3 is: 0.25
Enter two numbers:
2 1.5
area of numbers 2 and 1.5 is: 0.25
Enter two numbers:
1.5 3
area of numbers 1.5 and 3 is: 2.25
Transcribed Image Text:C++ Fast please Write a program in C++ using templates to create a generic function with the name area with two arguments, which receives either integer or float data types. The generic function evaluates the following algebraic expressions. = 2² - 2xy + y² Print the value of variable c. Sample output 1: Enter two numbers: 2.3.5 area of numbers 2 and 3.5 is: 2.25 Enter two numbers: 2.5 3 area of numbers 2.5 and 3 is: 0.25 Enter two numbers: 2 1.5 area of numbers 2 and 1.5 is: 0.25 Enter two numbers: 1.5 3 area of numbers 1.5 and 3 is: 2.25
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Types of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr