Here is the goal.
The coffee cost $1.25 and the cashier will offer to add on coffee like milk,cream,sugar or artSweet the problem is I only
know how to add only (1) one, I don't know how to allow my user to add more than 1 and display his ordered.
" Define a class named CoffeeOrder. Declare a private static field that holds the price of a cup of coffee as $1.25.
Include private integer fields that you set to a flag value of 1 or 0 to indicate whether the order should have any of
the following: cream, milk, sugar, or artificial sweetener. Include a public function that takes a user’s order from
the keyboard and sets the values of the four fields in response to four prompts. If the user indicates both milk and
cream, turn off the milk flag to allow only cream. If the user indicates both sugar and artificial sweetener, turn off
the artificial sweetener flag, allowing only sugar. Include another function that displays the user’s completed order.
Write a main() function that declares a CoffeeOrder object and calls the data entry and display methods. The
solution should continue to ask a user for an order in a loop until the user indicates the order is complete or 10
orders have been placed, whichever comes first. After the user indicates that ordering is complete, display a recap
of all the coffee orders, including the cream, milk, sugar, and sweetener status of each, as well as a count of the
number of coffees ordered and the total price. "
using namespace std;
static double cupOfCoffee;
cout<<"Your Coffee Includes: "<<flavor<<endl;
cout <<"Input 1 if you want to add: "<<endl;
cout <<"Do you want to add a cream? ";
cout <<"Do you want to add a Milk? ";
cout <<"Do you want to add a sugar? ";
cout <<"Do you want to add a Artificial Flavor? ";
if(cream == 1)
flavor = cream;
flavor = "cream";
if (milk == 1)
flavor = milk;
flavor = "milk";
if (sugar == 1)
flavor = sugar;
flavor = "sugar";
if (artSweet == 1)
flavor = artSweet ;
flavor = "artificial flavor";
double CoffeeOrder::cupOfCoffee = 1.25;