- Raw Codes
- Sample Output
- Description © mThree
- 🔜 coffee-shop-class: Used class, function, dictionary, loop, and condition
- coffee-shop-def: Used function, dictionary, loop, and condition
- coffee-shop-hash: Used dictionary, loop, and condition
- coffee-shop-ifelse: Used loop, and condition
A program that will calculate the cost of a custom cup of coffee at a gourmet coffee shop, based on the size of the cup, the type of coffee selected, and flavors that can be added to the coffee. It should complete the following steps:
- Ask the user what size cup they want, choosing between small, medium, and large
- Ask the user what kind of coffee they want, choosing between brewed, espresso, and cold brew
- Ask the user what flavoring they want, if any. Choices include hazelnut, vanilla, and caramel
- Calculate the price of the cup using the following values:
- Size:
- small: $2
- medium: $3
- large: $4
- Type:
- brewed: no additional cost
- espresso: 50 cents
- cold brew: $1
- Flavoring:
- None: no additional cost
- All other options: 50 cents
- Size:
- Display a statement that summarizes what the user ordered
- Display the total cost of the cup of coffee as well as the cost with a 15% tip, in phrases that explain the values to the user. Round the cost with tip to two decimal places
- For example, if the user asks for a medium-sized espresso with hazelnut flavoring, the total should be $4; the total with a tip should be $4.60 © mThree