Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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 fand h affect the states of the objects p and 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.x42; [2 marks] 11. void h(Point *p , Point *q) { p->x 42 p-gi 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. 6 marks] Total for Question 7: 12 marks]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part I Lnai 8724

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448475, 978-3662448472

More Books

Students also viewed these Databases questions

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago

Question

LO1 Identify why performance management is necessary.

Answered: 1 week ago