Barista Assistant
In your assignment, you get to practice your coding skills using:
- variables
- integers
- if then/else
- loops
- functions
- lists
Program Description:
Your program will create an application for a cafe to help baristas create coffee for a customer. Your program will take the customer's request and produce a set of instructions for the barista to make the coffee.
Your application will need to perform the following:
- Have the customer enter the type of coffee they want. Options include 'Long Black', 'Flat White', 'Latte', or 'Short Black'.
- If the customer does not provide one of the above options, your program will return the following error message:
Can you please try again.
- If the customer orders three types incorrectly, have your program exit with the following error message:
Sorry, we cannot help you here.
- With a correct coffee order that is either a long or short black, have your program ask the customer if they want milk on the side. Like the initial coffee order, the customer has three tries to answer correctly either with 'Y' or 'N'. If they do not answer correctly after three tries, have your program exit with the following error message:
Sorry, we cannot help you here.
- For any correct coffee order, have your program ask the customer if they would like their order for takeaway. Like the milk question, this question is asked three times for a response of either 'Y' or 'N'. After three unsuccessful attempts, have your program exit with the following error message:
Sorry, we cannot help you here.
- After all the correct answers have been given, have your program print out the customer's coffee request in the following format:
- Main Coffee Type
- Milk Extra
- Takeaway Option
- Use a function poseQuestion(questionPrompt, acceptableResponses) that performs the questioning operation. The function will check the customer's response based on the acceptableResponses list. This function is responsible for asking the question three times to get a correct response. Upon a successul response, the function will return the user's input. After three unsuccessful tries to get a correct answer, the function will return the string 'BAD INPUT' to tell your program to exit.
Hints:
- The following list is an example output for a customer ordering a 'Flat White' to be served in the cafe.
- Flat White
- No extras
- In cafe
- When checking the customer's request, your program does not have to check for character case sensitivity. For example, 'Y' and 'y' are the same, as well as 'Long Black' and 'long BLACK'.
- If you need some ideas on the different kinds of coffee, check out the Latte Art Guide with 12 different types mainly using milk, water, coffee (espresso).

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.