Define a class named BeveragePrivate Data Member: name - type string pointer (dynamic variable)Appropriate accessor and mutator functions.Default constructor and one argument constructor.Define pure virtual output function.Define a class named Soda derived from BeveragePrivate Data Member: price - type double pointer (dynamic variable)Appropriate accessor and mutator functions.Default constructor and two argument constructor.Override output function.Define a class named Beer driven from BeveragePrivate Data Member: alcohol_percentage - type double pointer (dynamic variable)Appropriate accessor and mutator functions.Default constructor and two argument constructor.Override output function.
int main() {Beverage *p,*q;p = new Soda("Gatorade",1.99);p->output(); // print "Name: Gatorade, Price: 1.99"q = new Beer("Budweiser",3.6);q->output(); // print "Name: Budweiser, Alcohol Percentage: 3.6"
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here