Question: Lab 5 A Void Functions Average Restaurant Rating and Number of Stars A restaurant receives numeric scores of 0 - 1 0 from five different
Lab A Void Functions
Average Restaurant Rating and Number of Stars A restaurant receives numeric scores of from five different food critics. The higher the score, the better the rating. The average score translates into a star rating.
Write an IPO diagram and Python program that has two functions, main and determinestars.
main Should accept input of five numeric ratings from the user USING A LOOP. It should then calculate the average numeric score for the restaurant. The numeric average should be passed to the determinestars function.
determinestars should display the number of stars based on the numeric average:
Greater than :
:
:
:
:
Below No stars
Design:
Design your program logic using pseudocode in the attached IPO Diagram. You should have separate diagrams. One for the main function and one for the determinestars function.
Modularity: Your program should contain functions: a main function to accept input from the user and calculate average and a second function to display the number of stars.
Input Validation: The test scores entered by the user should be in the range
Output: Display both the numeric average rounded to two decimals and the number of stars.
Sample Dialog:
Enter critic's score between and :
Error: Enter critic's score between and :
Enter critic's score between and :
Enter critic's score between and :
Enter critic's score between and :
Enter critic's score between and :
Your score of gives you
Programming Style Requirements.
Comments Begin your program with a comment that includes: a your name, bprogram status either Complete or describe any incomplete or nonfunctioning part of your program cA line description of what the program does.
Function comments each function should begin with a comment explaining what the function does
Variable names use meaningful variable names such as totaltaxes or numcookies.
Function names use meaningful verb names for functions such as displaytaxes.
Named constants Use named constants for all number values that will not be changed in the program such as RECIPESUGAR See section on Named Constants
You should have files to turn in:
Your program file: yourlastnameLabApy
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
