Question: Task 1: Write a C++ class, AllKinds, that has three member variables of type int, long, and float. The class must have a default constructor
Task 1: Write a C++ class, AllKinds, that has three member variables of type int, long, and float. The class must have a default constructor that initializes every variable to -1, have another constructor that takes in each variable type to initialize (three arguments), and have "getters" and "setters" for each type. (Example: getInt), setInt()...) Have public functions long intPlusLong ); float intPlusFloat ); float longMinusFloat O that take the sum or difference of the internal variables as implied by function name. Write a simple main) function to declare two instances of this class, one using the default constructor and one using the initialization constructor. For the class constructed with the default constructor, set each internal member variable of that class to a new number. Then call each arithmetic operator on both classes and print out the result. Select test values to demonstrate that your class is fully operational
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
