Using template feature of C++, program a class Calculator with two data members of the user specified
Fantastic news! We've Found the answer you've been seeking!
Question:
Using template feature of C++, program a class ‘Calculator’ with two data members of the user specified data type. The class should have a constructor to initialize these data members and the following functions. (Both function definitions are to be provided outside the class) .
a. A function to add the two data members
b. A function to multiply the data members
From your main program create objects of calculator for integer and float data members, call these functions and display the results.
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: