Question: Given the following class, what would be the best declaration for a constructor that would allow the user to initialize the object with an
Given the following class, what would be the best declaration for a constructor that would allow the user to initialize the object with an initial age and cost? class Wine { }; public: Wine(); int getAge(); float getCost (); private: int age; float cost; Select one: a. int getAge(int newAge); b. Wine (int newAge, float newCost); C. Wine(int age); d. Wine();
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
