1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Inga [223]
3 years ago
10

Design a program for the Hollywood Movie Rating Guide, which can be installed in a kiosk in theaters. Each theater patron enters

a value from 0 to 4 indicating the number of stars that the patron awards to the Rating Guide's featured movie of the week. If a user enters a star value that does not fall in the correct range, prompt the user continuously until a correct value is entered. The program executes continuously until the theater manager enters a negative number to quit. At the end of the program, display the average star rating for the movie.
Computers and Technology
1 answer:
ehidna [41]3 years ago
6 0

Answer:

The program in cpp is given below.

#include <iostream>

using namespace std;

int main()

{

   //variables declared to hold sum, count and average of movie ratings

   int sum=0;

   int count=0;

   int rating;

   double avg;

   //audience is prompted to enter ratings

   do{

       std::cout << "Enter the rating (0 to 4): ";

       cin>>rating;

       if(rating>4)

           std::cout << "Invalid rating. Please enter correct rating again." << std::endl;

       if(rating>=0 && rating<=4)

       {

           sum=sum+rating;

           count++;

       }

       if(rating<0)

           break;

   }while(rating>=0);

   //average rating is computed

   avg=sum/count;

   std::cout << "The average rating for the movie is " << avg << std::endl;  

   return 0;

}

OUTPUT

Enter the rating (0 to 4): 1

Enter the rating (0 to 4): 2

Enter the rating (0 to 4): 0

Enter the rating (0 to 4): 5

Invalid rating. Please enter correct rating again.

Enter the rating (0 to 4): 1

Enter the rating (0 to 4): -1

The average rating for the movie is 1

Explanation:

1. Variables are declared to hold the rating, count of rating, sum of all ratings and average of all the user entered ratings.

2. The variables for sum and count are initialized to 0.

3. Inside do-while loop, user is prompted to enter the rating for the movie.

4. In case the user enters a rating which is out of range, the user is prompted again to enter a rating anywhere from 0 to 4.

5. The loop executes until a negative number is entered.

6. Inside the loop, the running total sum of all the valid ratings is computed and the count variable is incremented by 1 for each valid rating.

7. Outside the loop, the average is computed by dividing the total rating by count of ratings.

8. The average rating is then displayed to the console.

9. The program is written in cpp due to simplicity since all the code is written inside main().

You might be interested in
Lin is creating a template for the configuration of Windows servers in her organization. The configuration includes the basic se
larisa86 [58]

The type of document should she create is  baseline document. Check more about the term Baseline below.

<h3>What is a Baseline document?</h3>

A Baseline document is known to be a kind official or legalized document that has passed through some measures of start approval and was used for its purpose.

Note that for Lin to be able to make the template for the configuration of Windows servers, the type of document that she can create is  baseline document.

Learn more about Windows servers  from

brainly.com/question/14526761

#SJ1

3 0
1 year ago
For each of the following memory accesses indicate if it will be a cache hit or miss when carried out in sequence as listed. Als
nika2105 [10]

Answer:

Explanation:

Operation Address Hit? Read Value

Read 0x834 No Unknown

Write 0x836 Yes (not applicable)

Read 0xFFD Yes CO

6 0
3 years ago
Which program, available on all operating systems, provides all types of information from a dns server and allows you to query a
JulsSmile [24]

The program Nslookup, is available on all operating systems and provides all types of information from a DNS server and allows you to query all types of information from a DNS server and change how your system uses DNS.

The network administration command-line tool nslookup can be used to verify that your DNS servers can resolve external domain names.

6 0
3 years ago
Plsss help u will get brainliest
liberstina [14]

Answer:

Young-at-Heart having a youthful or fresh spirit not depended of one's age; act in a way like younger person does.

Yare lively; eager; keen; agile; dexterous; ready; prepared.

Explanation:

got those ones hope it helps

4 0
3 years ago
Read 2 more answers
How does our behavior change when we know we're being watched?
Hoochie [10]

I can't even say this is an answer

If there isn't a specific answer for this, I think it depends on everyone. Maybe they'd behave better knowing that their actions are being monitored. Who in their right mind is going to act like a lunatic when they know people are watching.

I think it will most likely alter their attitude in a positive way but it will also most likely be fake actions put on show

5 0
2 years ago
Other questions:
  • An excel user should use a relative cell reference when it is important to ____. preserve the relationship to the formula locati
    7·1 answer
  • To quickly modify fonts, colors, and effects on a slide, a user can modify the _____. (Microsoft PowerPoint)
    11·1 answer
  • Jeremy’s office is in an earthquake prone area. His web server is in his office. What step should he take to protect the data on
    5·1 answer
  • Purpose Your goal is to create a design for a software interface. You will experience the scope of the design process from brain
    7·1 answer
  • I have $80 and I want a smartphone that you can call for free what should I get
    14·2 answers
  • ______ is a disadvantage of EDI.
    8·1 answer
  • How do you customize Track Changes in a text document?
    11·1 answer
  • Hannah decides to burn her video portfolio to a DVD. She wants to hand it over to a movie producer she will meet at a social eve
    15·1 answer
  • How can you find the square root of 8 using the pow() function
    10·1 answer
  • Which feature is not in ms PowerPoint​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!