CLASS: Drink The Drink class represents a single drink, including: * What kind o
ID: 3530146 • Letter: C
Question
CLASS: Drink The Drink class represents a single drink, including: * What kind of drink it is (coffee, tea, mocha, etc.) Default: coffee * Whether it is hot or cold Default: cold * The size of the drink in ounces Default: 12 The methods of the Drink class include: * ONE constructor, which has three arguments, one for each component mentioned above, and defaults set for each argument. * AddIngredient: This method adds a specified ingredient to the drink, affecting its description (see below). * SwitchTemperature method: This method changes a hot drink to cold, or changes a cold drink to hot. * Describe method: This method prints a phrase describing the drink, in this form: [hot/cold] [#]-ounce [drink] If the drink has one extra ingredient added, the form is: [hot/cold] [#]-ounce [drink] with [ingred] If the drink has more one extra ingredient added, the form is: [hot/cold] [#]-ounce [drink] with [ingred] and [ingred] ... and [ingred] */ class Drink { private: string what; bool isHot; int size; // in ounces vector extras; // added ingredients public: // Constructor Drink(string what, bool isHot, int size); // Accessor void Describe() const; // Mutators void AddIngredient(string ingredient); void SwitchTemperature(); }; // ** ADD CODE HERE: Write the implementation of the constructor Drink :: Drink(string kind, bool isHot, int size) { what = kind; ishot = temp; size = size; } // ** ADD CODE HERE: Write implementation of the Describe method void Drink :: Describe() const { } // ** ADD CODE HERE: Write the implementation of the AddIngredient method void Drink :: AddIngredient(string ingredient) { } // ** ADD CODE HERE: Write the implementation of the SwitchTemperature method void Drink :: SwitchTemperature() { } /* This is a main program that demonstrates the use of the Drink class. THIS IS AN EXAMPLE/INFORMATION ONLY. After each Describe method call, a comment shows what would be printed at that point in the program. Please DELETE THIS CODE before submitting. */ int main() { Drink plain; plain.Describe(); // cold 12-ounce coffee Drink fancy("triple mocha"); fancy.Describe(); // cold 12-ounce triple mocha Drink picard("Earl Grey tea", true); picard.Describe(); // hot 12-ounce Earl Grey tea Drink epic("banana milkshake", false, 64); epic.Describe(); // cold 64-ounce banana milkshake Drink mydrink; mydrink.AddIngredient("cream"); mydrink.Describe(); // cold 12-ounce coffee with cream mydrink.SwitchTemperature(); mydrink.Describe(); // hot 12-ounce coffee with cream mydrink.AddIngredient("sugar"); mydrink.Describe(); // hot 12-ounce coffee with cream and sugar mydrink.AddIngredient("cinnamon"); mydrink.Describe(); // hot 12-ounce coffee with cream and sugar and cinnamon }Explanation / Answer
This looks like an simple project. You just have to fill in the class definition. If you finished rating the other answerer and have not given any of them a 5 star, comment here and I'll see what I come up with.