Solved

Given the Following Class, What Is Syntactically Wrong with the Implementation

Question 52

Multiple Choice

Given the following class, what is syntactically wrong with the implementation of the display function?
Class Rational
{
Public:
Rational) ;
Rationalint numer, int denom) ;
Rationalint whole) ;
Int getNumerator) ;
Int getDenominator) ;
Friend void displayostream& out, const Rational& value) ;
Private:
Int numerator;
Int denominator;
};
Void displayostream& out, const Rational& value)
{
Out << value.getNumerator) << '/"<<value.getDenominator) ;
}


A) nothing
B) value must be not be pass by reference
C) The get functions are not const functions
D) out should be pass by value

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions