Summary 4 This program allows each theater patron to enter a value from 5 0 to 4 indicating the number of stars that the patron awards 6 to the Guide's featured movie of the week. The program 7 executes continuously until the theater manager enters a 8 negative number to quit. At the end of the program, the 9 average star rating for the movie is displayed. In this lab, you write a while loop that uses a sentinel value to control a loop in a Python program. You also write the statements that make up the body of the loop. 10 The source code file already contains the necessary assignment 1 and output statements. Each theater patron enters a value from 0 12 # Initialize variables. to 4 indicating the number of stars that the patron awards to the 13 totalStars = 0 # total of star ratings. 14 numPatrons = 0 # keep track of number of patrons Guide's featured movie of the week. The program executes 15 continuously until the theater manager enters a negative number 16 to quit. At the end of the program, you should display the average 17 # Get input. star rating for the movie. 18 numStarsString = input("Enter rating for featured movie: ") 19 20 # Convert to double. Instructions 21 numStars = float(numStarsString) 22 1. Make sure the file MovieGuide.py is selected and open. 23 # Write while loop here 24 2. Write the while loop using a sentinel value to control the loop, 25 # Calculate average star rating and also write the statements that make up the body of the 26 print("Average Star Value: " + str(averageStars)) loop. 27 3. Execute the program by clicking the Run button at the bottom of the screen. o Input the following as star ratings: 0, 3, 4, 4, 1, 1, 2, -1 4. Ensure that the average output is correct.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
2 PMOV
3
Summary
4 This program allows each theater patron to enter a value from
5 0 to 4 indicating the number of stars that the patron awards
In this lab, you write a while loop that uses a sentinel value to
6 to the Guide's featured movie of the week. The program
control a loop in a Python program. You also write the statements
7 executes continuously until the theater manager enters a
8 negative number to quit. At the end of the program, the
that make up the body of the loop.
9 average star rating for the movie is displayed.
The source code file already contains the necessary assignment
11
and output statements. Each theater patron enters a value from 0
12 # Initialize variables.
13 totalStars = 0
# total of star ratings.
# keep track of number of patrons
to 4 indicating the number of stars that the patron awards to the
14 numPatrons = 0
Guide's featured movie of the week. The program executes
15
continuously until the theater manager enters a negative number
16
to quit. At the end of the program, you should display the average
17 # Get input.
star rating for the movie.
|18 numStarsString = input("Enter rating for featured movie: ")
19
20 # Convert to double.
Instructions
21 numStars = float(numStarsString)
22
23 # Write whi
1. Make sure the file MovieGuide.py is selected and open.
loop
24
2. Write the while loop using a sentinel value to control the loop,
25 # Calculate average star rating
26 print("Average Star Value: " + str(averageStars))
27
and also write the statements that make up the body of the
loop.
3. Execute the program by clicking the Run button at the bottom
of the screen.
o Input the following as star ratings: 0, 3, 4, 4, 1, 1, 2, -1
4. Ensure that the average output is correct.
Transcribed Image Text:2 PMOV 3 Summary 4 This program allows each theater patron to enter a value from 5 0 to 4 indicating the number of stars that the patron awards In this lab, you write a while loop that uses a sentinel value to 6 to the Guide's featured movie of the week. The program control a loop in a Python program. You also write the statements 7 executes continuously until the theater manager enters a 8 negative number to quit. At the end of the program, the that make up the body of the loop. 9 average star rating for the movie is displayed. The source code file already contains the necessary assignment 11 and output statements. Each theater patron enters a value from 0 12 # Initialize variables. 13 totalStars = 0 # total of star ratings. # keep track of number of patrons to 4 indicating the number of stars that the patron awards to the 14 numPatrons = 0 Guide's featured movie of the week. The program executes 15 continuously until the theater manager enters a negative number 16 to quit. At the end of the program, you should display the average 17 # Get input. star rating for the movie. |18 numStarsString = input("Enter rating for featured movie: ") 19 20 # Convert to double. Instructions 21 numStars = float(numStarsString) 22 23 # Write whi 1. Make sure the file MovieGuide.py is selected and open. loop 24 2. Write the while loop using a sentinel value to control the loop, 25 # Calculate average star rating 26 print("Average Star Value: " + str(averageStars)) 27 and also write the statements that make up the body of the loop. 3. Execute the program by clicking the Run button at the bottom of the screen. o Input the following as star ratings: 0, 3, 4, 4, 1, 1, 2, -1 4. Ensure that the average output is correct.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY