Question: in c++ please Digicup This program simulates interactions with a cup object for getting a drink, refilling a drink, emptying a drink, and drinking from



in c++ please
Digicup This program simulates interactions with a cup object for getting a drink, refilling a drink, emptying a drink, and drinking from it. Output All of the output statements (std::cout) should be in main and are mostly provided for you. You will only need to complete missing logic to construct a cup object and call the appropriate member functions in the cup class. The Cup object will be used to ask the user for the type of drink they prefer and the amount they want to drink. The menu options are shown below for your reference: D: Drink R: Refill N: Get a brand new drink E: Empty X: Exit The Cup class State (member variables) Create a class called Cup with the following member variables: 1. drink_type which is a std::string that will be the name of the drink. 2. fluid oz which is a double that will be the amount of fluid in the cup. Constructors Default constructor The default constructor should initialize drink_type_ to "Water" and initialize fluid_oz_ to 16.0 Non-default constructor The non-default constructor should take in a std::string parameter that will be the name of the drink type and a double parameter that will be the amount of drink in the cup in fluid ounces. It should set the passed parameter values to the corresponding data members. Member functions & Drink Create a function called Drink which accepts one double as a parameter. Drinking reduces the amount of liquid in the cup based on a given double that is passed as input. Take note that fluid_oz_ should never be negative, so if you drink an amount that is greater than fluid_oz_, then fluid oz should be set to 0. Refill Create a function called Refill which accepts one double as a parameter. Refilling the cup increases the amount of liquid in the Cup based on the given input. Assume the cup is bottomless. NewDrink
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
