C++: complete the class TT
Not what you're looking for?
When run, the following program should display following on screen.
90 225
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
Purchase this Solution
Solution Summary
The solution mentions the additions to be made to the given code, and also gives the updated code.
Solution Preview
You can make following addition to your code, in mentioned place, to achieve the goal.
TT operator + ...
Purchase this Solution
Free BrainMass Quizzes
Basic Networking Questions
This quiz consists of some basic networking questions.
Inserting and deleting in a linked list
This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.
Excel Introductory Quiz
This quiz tests your knowledge of basics of MS-Excel.
Java loops
This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.
Javscript Basics
Quiz on basics of javascript programming language.