operator +

Pages: 12
and , am i display correctly all the information according to my question?

this question been complained by a lot of my classmates . they feel that this question are foolish-ing us
i get it already .. i modify the main.cpp again. can u help me confirm isn't fullfill the question requirement??

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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?
Last edited on
they feel that this question are foolish-ing us
Probably yes.

am i correct for my question?
Probably no.

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
Topic archived. No new replies allowed.
Pages: 12