What is wrong with the following member function definition given the class below?
class Rational
{
public:
Rational();
Rational(int numer, int denom);
Rational(int whole);
int getNumerator() const;
int getDenominator() const;
friend void display(ostream& out, const Rational& value);
private:
int numerator;
int denominator;
};
int Rational::getNumerator() const
{
numerator = 0;
return numerator;
}
a. You can not set the numerator to zero
b. The function may not modify numerator, but it can modify denominator
c. The function may not modify any of the private data members
d. nothing
e. A and B
f. A and C
f. A and C
You might also like to view...
Which of the following storage devices has the most capacity?
A) CD B) Cache C) BD D) DVD
A random number, created as an object of the Random class, is always a(n) __________.
a. object b. integer c. float d. class