Uploaded by amelio jenkins

CoffeeOrderStringsNew

advertisement
Coffee Order Strings Assignment
Write a program that creates a coffee order. A coffee order consists of a price, a
flavor, and cream (Y/N), sugar (Y/N), and coffee size (S/M/L).
Your main() function will call an orderCoffee() function that will ask the user for the
flavor, size and whether or not they want cream or sugar.
Your main() function will then call a displayOrder() function that will display the
coffee order and the price. A small is $3.00, medium is $4.50, and large is $6.00.
Continue to take coffee orders until there are no more coffee orders.
Your orderCoffee() function will contain an array of strings for the available flavors:
"House", "Iced", "Vanilla", "Hazelnut", "Mocha"
Your orderCoffee() function will then ask the user what size of coffee they would
like (Small/Medium/Large) and validate the data allowing them to continue until
they answer correctly. You must consider both upper and lower case.
Using your array of strings, display the various available flavors and ask the user for
the flavor using strings. Validate the data allowing them to continue until they
answer correctly. You must consider both upper and lower case.
Lastly, ask the user if they would like cream (Y/N) and ask if they would like sugar
(Y/N). validate the data allowing them to continue until they answer correctly.
You must consider both upper and lower case.
Your displayOrder() function must display like one of the following ways based on
the order.
Your coffee order:
Small vanilla coffee with cream and sugar
Total due:
$ 3.00
Your coffee order:
Medium hazelnut coffee with sugar
Total due:
$ 4.50
Your coffee order:
Large iced coffee with cream
Total due:
$ 6.00
Your coffee order:
Small house coffee
Total due:
$ 3.00
Download