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
The system should enable the staff of each academic department to examine the courses offered by their department, add and remov
Ganezh [65]

Answer:

See attached picture.

Explanation:

See attached picture.

3 0
3 years ago
Four categories of installer apps
Naddika [18.5K]

Answer:

I find 5 categories

Explanation:

1 Overview

2 Necessity

3 Types

4 Attended installation

4.1 Silent installation

4.2 Unattended installation

4.3 Headless installation

4.4 Scheduled or automated installation

4.5 Clean installation

4.6 Network installation

5 Installer

5.1 Bootstrapper

5.2 Common types

5.3 System installer

7 0
3 years ago
Is the following a true statement in our world? Why or why not?
posledela

Answer:

The statement would be true

.

Explanation:

let,  L = is a NFL player

      M = teaches in CSU

      N = has tattoos

Given that:

nfl player who teaches in csu = L^ M                 (this is false every time)

Above statement is L ^ M -> N

this would be true because

false -> true                  (true

)

false -> false                  (true

)

Second  exp:

There are no players who teach in Csu therefore if we say they all have tattoos statement would be true.

4 0
3 years ago
Can Anybody Answer This For Me ?
AlladinOne [14]

Answer:

I'm pretty sure its 3 only (c) III only gimme brainliest

3 0
3 years ago
Tasha purchased a new tablet. She has several questions about how to connect to the internet, download apps, install software, a
lutik1710 [3]
The answer is D because a toutourial can explain each and everey process

6 0
3 years ago
Other questions:
  • _____ is defined as an attraction for a source based on a resemblance between the source and receiver of a message.
    15·1 answer
  • What is commodity? explain
    14·1 answer
  • Case 2-2 Jack has a computer at home that he uses to access the Internet, store and edit personal photos, and create and edit do
    9·1 answer
  • How do I give Brainliest? Will give brainliest when I figure out how
    8·2 answers
  • Draw a flowchart or write pseudocode to represent a program's logic that allows the user to enter a value. The program multiplie
    5·1 answer
  • Your friend Amy calls you asking for help with her new LCD monitor. She says the monitor isn't showing the whole picture. What i
    14·1 answer
  • Which of the following class definition defines a legal abstract class Group of answer choices public class Rectangle abstract {
    15·1 answer
  • In Tynker, it is not possible to create a/an __________.
    6·2 answers
  • How to hack a I'd Indian brainly bot​
    7·1 answer
  • How have these advances in-home technology changed the role of technicians in our society?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!