Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this lab, you write a while loop that uses a sentinel value to control a loop in a C++ program that has been provided.

In this lab, you write a while loop that uses a sentinel value to control a loop in a C++ program that has been provided. You also write the statements that make up the body of the loop. The source code file already contains the necessary variable declarations and output statements. Each theater patron enters a value from 0 to 4 indicating the number of stars the patron awards to the Guides 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. Instructions Ensure the source code file named MovieGuide.cpp is open in your code editor. Write the while loop using a sentinel value to control the loop, and write the statements that make up the body of the loop. The output statements within the loop have already been written for you. Ensure you include the calculations to compute the average rating. Execute the program by clicking the Run button. Input the following: 0, 3, 4, 4, 1, 1, 2, -1 Ensure the average output is correct.

Program produces correct output

1

0 out of 1 checks passed. Review the results below for more details.

Checks

Test CaseIncomplete

Average test 1

Input

0 3 3 4 2 -1 

Output

Enter the rating of a movie and press negative value to quit 0 3 3 4 2 -1 2.4 

Results

Average Star Value: 2.4

Show Details

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions

Question

1. How do most insects respire ?

Answered: 1 week ago

Question

Who is known as the father of the indian constitution?

Answered: 1 week ago

Question

1.explain evaporation ?

Answered: 1 week ago

Question

Who was the first woman prime minister of india?

Answered: 1 week ago

Question

Explain the concept of going concern value in detail.

Answered: 1 week ago

Question

1. Who will you assemble on the team?

Answered: 1 week ago