Question: Consider the following code. Is there a syntax error, and if so , what is it ? class Car { public: Car ( double tank
Consider the following code. Is there a syntax error, and if so what is it
class Car
public:
Cardouble tanksiz;
double gettankSize const;
void settankSizedouble size;
private:
double tanksize;
;
class Chevy : car
public:
Chevy;
double getmpg const;
void addmilesdouble miles;
private:
double enginesize;
double milestravelled;
;
Question options:
No syntax error, but a main using the Chevy class will not be able to call gettankSize
No syntax error and no design problems
The parameter is spelled wrong in the prototype for Car double tanksiz; It doesn't match the private variable name.
None of these
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
