Question: Question 7 (a) When a class member is defined outside the class, which operator can be used [2 marks] (b) How do the calls of

 Question 7 (a) When a class member is defined outside the

Question 7 (a) When a class member is defined outside the class, which operator can be used [2 marks] (b) How do the calls of the functions f and h affect the states of the objects p andd to associate the function definition to a particular class? q of class Point in each of the examples. Explain your answers. i. void f(Point p, Point q) P.x - 42; P-9: [2 marks] ii. void h(Point *p, Point *) f p->x - 42; p-q. [2 marks] (c) Write a class for an object called Job that has two integer variables startingTime and completionTime. Job should also have a default constructor and two pub- lic functions getProcessingTime and reschedule with the signatures: int getProcessingTime void reschedule (int newStartingTime, int newCompletionTime); Function getProcessingTime returns the processing time as the difference between completionTime and startingTime. Function reschedule changes the values of startingTime and completionTime, respectively, to newStartingTime and newCompletionTime when the new com- pletion time is greater than or equal to the new starting time. Otherwise, no action is performed. The default constructor initialises both startingTime and completionTime to 0 Assuming that the C++ code has been declared separately, write the C++ body code for these functions and the default constructor

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!