Question: PLEASE DO NOT COPY PASTE FROM CHEGG/OTHERWISE I'LL REPORT YOU 2. (20 PTS) In this lab, you will write a while loop that uses a

PLEASE DO NOT COPY PASTE FROM CHEGG/OTHERWISE I'LL REPORT YOU

PLEASE DO NOT COPY PASTE FROM CHEGG/OTHERWISE I'LL REPORT YOU 2. (20

2. (20 PTS) In this lab, you will write a while loop that uses a sentinel value to control a loop in a Python program. You will also write the statements that make up the body of the loop. The code below already contains the necessary assignment and output statements. Each theater patron enters a value from 0 to 4 indicating the number of stars that the patron awards to the Guide's featured movie of the week. The program executes continuously until the theater manager enters a negative number to quit. At the end of the program, you should display the average star rating for the movie. For each comment add to the program by: 1. Writing the while loop using a sentinel value to control the loop, and also write the statements that make up the body of the loop. 2. Execute the program. Input the following as star ratings: 0, 3, 4, 4, 1, 1, 2, -1 3. Ensure that the average output is correct. 4. Save as MovieGuide.py. # Initialize variables. totalStars = 0 # total of star ratings. numPatrons = 0# keep track of number of patrons # Get input. numStars String = input("Enter rating for featured movie: ") # Convert to double. numStars = float(numStarsString) # Write while loop here # Calculate average star rating print("Average Star Value: " + str(average Stars) 2. (20 PTS) In this lab, you will write a while loop that uses a sentinel value to control a loop in a Python program. You will also write the statements that make up the body of the loop. The code below already contains the necessary assignment and output statements. Each theater patron enters a value from 0 to 4 indicating the number of stars that the patron awards to the Guide's featured movie of the week. The program executes continuously until the theater manager enters a negative number to quit. At the end of the program, you should display the average star rating for the movie. For each comment add to the program by: 1. Writing the while loop using a sentinel value to control the loop, and also write the statements that make up the body of the loop. 2. Execute the program. Input the following as star ratings: 0, 3, 4, 4, 1, 1, 2, -1 3. Ensure that the average output is correct. 4. Save as MovieGuide.py. # Initialize variables. totalStars = 0 # total of star ratings. numPatrons = 0# keep track of number of patrons # Get input. numStars String = input("Enter rating for featured movie: ") # Convert to double. numStars = float(numStarsString) # Write while loop here # Calculate average star rating print("Average Star Value: " + str(average Stars)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!