Menu

[solved]-Use C Given Template Type Two Numbers N1 N2 Create Class Problemsolution Following Charact Q39078937

use c++

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 aparameterized constructor to initialize the members.
  • Inside class create a public member function ‘add’ with noargument, to calculate addition of member variables and returnaddition 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].

Expert Answer


Answer to use c++ Given template type, two numbers N1 and N2, create a class ‘ProblemSolution’ with following characteristics The … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *