
Concept explainers
Create a flowchart using Flowgorithm and Pseudocode for the following
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.

Here is the pseudocode for the program:
Start
Declare variables:
- total_items_purchased = 0
- total_customers = 0
- total_age = 0
- zip_code = -1
- age = -1
- num_items = -1
While zip_code != 0 Do
Input zip_code
If zip_code != 0 Then
Input age
While age < 10 OR age > 100 Do
Display "Invalid age. Please enter a valid age."
Input age
End While
Input num_items
Set total_age = total_age + age
Set total_items_purchased = total_items_purchased + num_items
Set total_customers = total_customers + 1
End If
End While
If total_customers > 0 Then
Set average_age = total_age / total_customers
Display "Average customer age: ", average_age
End If
Display "Total items purchased: ", total_items_purchased
End
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

- calcAverage function: This is function that returns no value and accept no parameters. This function will do the following: Ask the user to enter how many integers to enter. This has to be a positive integer and you need to validate that Write a “for” loop to accept this many integers and write the needed logic to calculate the average of these numbers and print that out Then the function will return back to the main functionarrow_forwardC# languagearrow_forwardThe code is not printing the correct result. Please explain to me step by step.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





