Using the coffeeorder class write a mainfunction that


a. 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. Save the file as Coffee.cpp.

b. Using the CoffeeOrder class, write a main()function that continues 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. Save the file as Coffee2.cpp.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Using the coffeeorder class write a mainfunction that
Reference No:- TGS02192777

Expected delivery within 24 Hours