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;
}
A) int getAgeint newAge) ;
B) Wine) ;
C) Wineint age) ;
D) Wineint newAge, float newCost) ;
Correct Answer:
Verified
Q43: Member functions of a class
A) may not
Q44: In a class, all members are _
Q45: In a struct, all members are _
Q46: Which part of the ADT tells the
Q47: Given the following class definition, what is
Q49: Given the following class and object declaration,
Q50: A derived class has access to
A) the
Q51: If you design a class with private
Q52: If you are designing a class for
Q53: A class member function that automatically initializes
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents