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.
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...
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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5b4afaba-eeab-4f16-8fe3-57d1f7966dfc%2F19d5e075-9ad7-4c2b-a8e7-e4af0ba3b001%2Fufst386_processed.png&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY