int main(){
//Set multiple Homework object
Homework thehomework1 , thehomework2;
//Set information for first homework
thehomework1.setClassName( "PSDC Batch 18 CE");
thehomework1.setAssignment( "Read Chapter 11" );
thehomework1.set_numOfminutes( 150 );
//Set information for second homework
thehomework2.setClassName( "Inti Batch 1 CS" );
thehomework2.setAssignment( "Read Chapter 22" );
thehomework2.set_numOfminutes( 280 );
Homework homework3 = AddTwoValues(thehomework1,thehomework2);
//Output display for Homework 1 and homework 2
cout << "Name for first class : " << thehomework1.getClassName() << endl
<< "Assignment title : " << thehomework1.getAssignment() << endl << endl
<< "Number of minutes that will take to complete assignment : " << thehomework1.get_numOfminutes() << endl << endl
<< "Name for second class : " << thehomework2.getClassName() << endl
<< "Assignment title : " << thehomework2.getAssignment() << endl << endl
<< "Number of minutes that will take to complete assignment : " << thehomework2.get_numOfminutes() << endl << endl ;
cout << "Summary of time for the assignments that required [integer] : "
<< AddTwoValues( 30 , 40 )//with integer arguments
<< "minutes" << endl;
cout << "Summary of time for the assignments that required [double] : "
<< AddTwoValues( 30.28 , 49.18 )//with double arguments
<< "minutes" << endl;
cout << "The result of addition of Homework objects : " << homework3.get_numOfminutes() << endl;
system( "pause" );//Pause window
return 0;//Terminate the program
}
those i line it up 1. isn't correct? finally i can get what you mean. haha.
and am i correct for my question?
The problem is that homework3 does not contain the right information. Currently it says that you need 430 min for "PSDC Batch 18 CE"/ "Read Chapter 11" which is wrong.
this
overload the operator + to add the minutes
reads as if the operator would be Homework operator+(int number_of_minutes_to_add), but that's wrong as well.
I would expect an output for the result like:
Result homework:
class: PSDC Batch 18 CE and Inti Batch 1 CS
title: Read Chapter 11 and Read Chapter 22
minutes: 430