Build Flowgorithm Flowchart and write pseudocode -- 2
Budget: $10 – $30 USD
You are to design a program for Alexander's Coffee Shop providing customer research data. When a customer places an order, the clerk asks the customer for their zip code and age. The clerk enters this data as well as the number of items purchased. The program should operate continuously until the clerk enters a 0 for the zip code at the end of the day. If the clerk enters an invalid age (defined as less than 10 or more than 100), an error message is displayed and the program re-prompts the clerk continuously to enter a valid age. At the end of the program, display the average customer age and the total number of items purchased.
Two looping structures should be used. The first one will allow the user to continue to enter the data until they are finished, using the zip code equaling zero to end. Then you will need a while () loop to determine if the age is valid (age greater than 10 or less than 100), if the age is invalid you should prompt the user to enter a valid age storing the new age with an input statement. When the age is valid you need to keep a total so that you can average the age. You will do this by creating two assignment statements. The first one will count the valid ages and the second one will need to total the valid ages. You will compute the average as the last command before the program ends (outside of both loops). Average = total ages/count. You will also need to keep track of the total items purchased for all valid ages. You should add an accumulating total assignment in the area where the ages are valid.
Two looping structures should be used. The first one will allow the user to continue to enter the data until they are finished, using the zip code equaling zero to end. Then you will need a while () loop to determine if the age is valid (age greater than 10 or less than 100), if the age is invalid you should prompt the user to enter a valid age storing the new age with an input statement. When the age is valid you need to keep a total so that you can average the age. You will do this by creating two assignment statements. The first one will count the valid ages and the second one will need to total the valid ages. You will compute the average as the last command before the program ends (outside of both loops). Average = total ages/count. You will also need to keep track of the total items purchased for all valid ages. You should add an accumulating total assignment in the area where the ages are valid.