How to complete the class in a code


Discuss the below:

Q1: When run, the following program should display following on screen.

90 225

Q2: Complete the class TT in order to make the program run.

#include < iostream >
using namespace std;

class TT
{
protected:
int value1;
int value2;
public:
TT(int i=0, int j=0) { value1 = i; value2 = j; }
.
. (To Be Completed By You)
.
}; // TT

int main() // You are NOT allowed to change the main() function.
{
TT Sum, A[3] = { TT(20, 50.0), TT(30, 75.0), TT(40, 100.0) };

for (int i=0; i < 3; ++i)
Sum = Sum + A[i];
cout << Sum;
return 0;
} // main

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: How to complete the class in a code
Reference No:- TGS01937042

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)