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...
A protocol analyzer shows that the average frame size of data packets being delivered to and from the campus network’s Internet connection is 1203. Is this a reasonable average? Justify your answer.
What will be an ideal response?
Explain how packet sniffers can be used for both good and bad.
What will be an ideal response?
InDesign names duplicated layers with the same name as the layer that was used to create the duplicate followed by the word ____.
A. duplicate B. mimic C. copy D. extra
Characteristics that define a field or other controls are called field lists
Indicate whether the statement is true or false