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 20:00
When you mouse over and click to add a search term this(these) boolean operator(s) is(are) not implied. (select all that apply)?
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
You wanted to look up information about alzheimer's, but you were unsure if it was spelled "alsheimer's" or "alzheimer's." which advanced search strategy would be useful? a) a boolean search b) using a wild card in your search c) trying different search engines d) doing a search for "alsheimer's not alzheimer's" asap. ill give brainlist.
Answers: 1
question
Computers and Technology, 23.06.2019 23:00
How do you know if the website is secure if you make a purchase
Answers: 2
question
Computers and Technology, 24.06.2019 11:30
Convert 11001110(acdd notation) into decimal
Answers: 2
You know the right answer?
Find addition of two numbers using Class Template Given template type, two numbers N1 and N2, creat...
Questions
Questions on the website: 13722360