Question: In c++ create a base class called Drinks that has the following characteristics: Features a builder that receives the flavor and milliliters It has
In c++ create a base class called Drinks that has the following characteristics: Features a builder that receives the flavor and milliliters It has a method called show that displays the flavor and the milliliters Create a class called Sodas and derive it from the base class. You must have the following: It has a constructor that receives the flavor, the milliliters, and the calories (the first two were already requested in the Drinks class). It has a method called show that displays the flavor, the milliliters and the calories. You need to call the function from the base class and fill in the calories part. In the main program create a vector with 2 elements (soda). Call the show method. The output should look like this Loading the following data for the constructor: Soda ("Kiwi", 100,76.56); Soda ("Strawberry",200,13.99); The output should look like this Name: Kiwi Milliliters: 100 Calories: 76.56 Name: Strawberry Milliliters: 200 Calories: 13.99
Step by Step Solution
3.46 Rating (149 Votes )
There are 3 Steps involved in it
Heres an example implementation in C that fulfills the requirements specified include include includ... View full answer
Get step-by-step solutions from verified subject matter experts
