subject

Find addition of two numbers using Class Template Given template type, two numbers N1 and N2, create a class 'ProblemSolution' with following characteristics
The class contains two private members of type template, and a parameterized constructor to initialize the members.
Inside class create a public member function 'add' with no argument, to calculate addition of member variables and return addition of template type.
Input
1
2
6
Where,
The first line contains the data type which can be 1 or 2. i. e. 1 for integer and 2 for float.
The second line contains input N1.
The third line contains input N2.
Output
8
Assume that,
N1 and N2 numbers are within the range [-1000 to 1000].
Not sure where to start, please use template below, C++:
#include
#include
using namespace std;
like cout/cin.
//write your code here
int main()
{
int I1, I2;
float F1, F2;
int dataType;
cin>> dataType;
if(dataType==1){
cin>>I1;
cin>>I2;
ProblemSolution problemSolution(I1, I2);
cout< }else if(dataType==2){
cin>>F1;
cin>>F2;
ProblemSolution problemSolution(F1, F2);
cout< }
return 0;
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:20
Terri needs to insert a cover page into her document. where should she go to access the commands to do so? o insert tab, objects group o insert tab, illustrations group o insert tab, pages group o insert tab, media group submit
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
What are listed in the vertical columns across the top of the event editor? a. file names b. conditions c. check marks d. action types
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
Amitha writes up a one-page summary of a novel during her summer internship at a publishing company. when she reads over the page, she realizes she used the word “foreshadow” seven times, and she would like to reduce the repetition. which tool would best amitha solve this problem?
Answers: 3
question
Computers and Technology, 23.06.2019 23:30
Worth 50 points answer them bc i am not sure if i am wrong
Answers: 1
You know the right answer?
Find addition of two numbers using Class Template Given template type, two numbers N1 and N2, creat...
Questions
question
Mathematics, 19.03.2021 14:00
question
English, 19.03.2021 14:00
question
Computers and Technology, 19.03.2021 14:00
question
Mathematics, 19.03.2021 14:00
question
Mathematics, 19.03.2021 14:00
Questions on the website: 13722363