CSI 230 Chapter 13 Programming Problem This program is a continuation of the Module 6 program. 1) WRITE A CLASS DIAGRAM for the coffee class described below. 2) Change the program written in Module 6...

Im having trouble with figuring out how to convert them to classes and enumerate them. Thank you


CSI 230 Chapter 13 Programming Problem This program is a continuation of the Module 6 program. 1) WRITE A CLASS DIAGRAM for the coffee class described below. 2) Change the program written in Module 6 so that it uses a class for the coffee orders. The specification for the coffee class is given below. 3) 3) Coffee - a. Attributes: Coffee struct{name, cost, strength, size, sugar, cream}, OrderNumber AmountColumbian, AmountFrench, AmountItalian, AmountHouse, AmountSugar, AmountCream: b. Member functions: ReceiveOrder(), RemoveProduct(), LowProductWarn(), RefillProduct(), ProduceOrder() c. Notes: initial and "full" amounts for each product are as follows: each coffee type - 2 lbs, sugar - 1 lb, cream - 25 oz. You can create a constructor to do this. d. Description: This class will receive an order which is, values for each of the coffee attributes (these will be taken in by the CoffeeOrder struct created in previous assignments and passed to the ReceiveOrder() method). The ReceiveOrder() method will call CalculateRemainProduct() to determine if there is enough product to complete the order. The class will then subtract the appropriate amount of each product from the respective Amounts. If a product does not have enough to fill an order then it returns a message that the order cannot be completed and which product is the cause. Then it calculates the remaining amounts and compares with the low amount threshold (low threshhold is enough product for 3 more cups). If the threshold is hit on one of the products a low product warning message is sent. The manager can Refill the appropriate product at any time. The final part of sending an order is to produce the order, which returns a message/signal stating the order is ready or that it cannot be filled due to lack of product (and which product is the cause). The amounts used are as follows: Coffee: an 0.25 ounce for each strength level of coffee, + .5 oz *size. Cream: 2 oz if selected. Sugar 1 teaspoon for each level. Recall : The values for coffee name are enumerated as Columbian=1, French Roast=2, Italian Blend=3, House=4; and the values for strength are enumerated as 1=light, 2=medium, 3=dark. Also, the attribute for coffee size that are enumerated as small=0, regular=1, medium=2, large=3, extra- large =4. The cost is calculated as follows; small $1.50, , regular $2.10, medium $2.50, large $3, extra-large $4.25. Add .25 if they choose French roast or Italian blend, add .13 for each level of sugar, and add .08 for cream. There is a struct for customer. The costumer has attributes for first name, order number which is a value between 1 and 100 inclusive, and a coffee struct. In the main program a single instance of customers is to be declared. Next the main menu is displayed. The menu will first ask if the customer wants a cup of coffee and provide choices for yes, no or quit. If the customer chooses yes, the program asks for the first name and stores it in the appropriate location. Next, the program displays the options and allow the user to enter their coffee preferences. The order preferences are passed to the coffee method ReceiveOrder(). Then the coffee classes will execute other member functions as described above. Then the customer’s order number should be displayed. Next the program will store information in a text file named “CustOrder.dat” as given below. OrderNumber, CoffeeName, strength, size, sugarAmount, cream, cost If in the main menu the customer chooses “no” then the system should show a menu with the following options 1) View an order (which will require an order number), 2) Calculate total profit which uses a function to add up all of the cost values in the file. The result is the total profit. 3) Refill a product which calls the RefillProduct() method. The program should loop until the user chooses to quit in the main menu.
Feb 25, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here