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
DENIUS [597]
3 years ago
14

How to write a C++ program that allows a user to enter their rating of the three movies in the Dark Knight Trilogy and then disp

lay each rating entered, the highest rating, the lowest rating, and the average of the ratings??
Computers and Technology
1 answer:
8_murik_8 [283]3 years ago
8 0

The program is an illustration of arrays.

Arrays are used to hold multiple values in one variable.

The program in C++ where comments are used to explain each line is as follows:

#include <iostream>

using namespace std;

int main(){

   //This declares an array of three elements for the three ratings

   int ratings[3];

   //This initializes the sum of the ratings to 0

   int total = 0;

   //The following iteration gets input for the three ratings

   for(int i = 0; i<3;i++){

       cin>>ratings[i];

       //This calculates the sum of all inputs

       total+=ratings[i];

   }

   //This declares and initializes the lowest and the highest ratings

   int lowest = ratings[0], highest = ratings[0];

   //This iterates through the array

   for(int i = 1; i<3;i++){

       //The following if condition determines the lowest rating

       if (lowest > ratings[i]){    lowest = ratings[i];        }

       //The following if condition determines the highest rating

       if (highest < ratings[i]){            highest = ratings[i];        }

   }

   //This prints the output header

   cout<<"The ratings are: ";

   //The following iteration prints the three ratings

   for(int i = 0; i<3;i++){

       cout<<ratings[i]<<" ";   }

   //The prints the highest ratings

cout<<endl<<"Highest: "<<highest<<endl;

   //The prints the lowest rating

   cout<<"Lowest: "<<lowest<<endl;

   //The prints the average rating

cout<<"Average: "<<total/3<<endl;

   return 0;

}

At the end of the program, the ratings entered, the highest rating, the lowest rating, and the average of the ratings are printed.

See attachment for sample run

Read more about similar programs at:

brainly.com/question/13261254

You might be interested in
computer hardware without software is useless while computer software without hardware is meaningless. explain what do you under
Rainbow [258]

Answer:

That the software is useless

Explanation:

6 0
3 years ago
DOES ANYONE KNOW HOW TO CHAGE THE IP ON A COMPUTER?
MaRussiya [10]
Try downloading a VPN

8 0
3 years ago
What item is at the front of the list after these statements are executed?
Veseljchak [2.6K]

Answer:

A.Sam.

Explanation:

We are using Deque interface which is sub type of  Queue interface. Deque supports insertion and deletion from both ends front and end.So it can be used as a queue and stack also.

In this question we have inserted Jack at the front first.Then Rudy at the back then larry also at the tail.Now we have added sam at the front then nothing is added to the front.So the answer is Sam.

7 0
3 years ago
Need 9&amp;10. Thank you! Btw it's due today.
NeTakaya
Q9. The metric system is an internationally adopted decimal system of measurement. It is widely used in the world and is the only or most common system of weights and measures. It is now known as the International System of Units (SI). It is used to measure everyday things such as a sack of flour, the height of a person, a tank of petrol, and the speed of a car. On the other hand, the United States customary units are a system of measurements commonly used in the United States. So, for the measurement above we have:

Distance from Los Angeles:

Given that the problem does not tell us the specific point for the distance from Los Angeles. We will assume that this point is New York, so:

*Metric: The unit for length is the meter.

d = 4488460 (m)

*U.S customary: For measuring length, the U.S. customary system uses the inch, foot, yard, and mile, so:

d = 176711023 (in)
d = 14725918 (ft)
d = 4908639 (yd)
d = 2789 (mi)

The temperature on a hot day:

*Metric: Degree Celsius is a unit of thermodynamic temperature. So, on a hot day the temperature is:

T = 35°

*U.S customary: Degrees Fahrenheit is used in the U.S. to measure temperatures, so:

T = 95°

The weight of a loaf of bread: 

*Metric: The unit used for mass is the kilogram. For a mass of 0.095 (kg), the weight that is a force (Newton is the unit for measuring weight) is given by:

w = 0.931 (N)

*U.S customary: Ounces is a unit of weight for this system, so:

w = 1 ounce

Length of a pencil: 

*Metric:
d = 0.095(m)

*U.S customary: 

d = 3.74 (in)
d = 0.311(ft)
d = 0.10 (yd)
d = 5.90 (mi)

The capacity of a container:

The capacity of an element is equal to the volume that is the quantity of three-dimensional space enclosed by a closed surface, so the capacity of a container very used these days  is:

*Metric: 

V = 33.2m^{3}

*U.S customary: The cubic inch, cubic foot and cubic yard are commonly used for measuring volume. So:

V=2025988in^{3}
V =1172.44ft^{3}
V =43.42yd^{3}

<span>Q10. We can explain this concept using an example for Small Businesses. The concept of Frustrated Users (Employees) is an example of a technological problem. Interacting with technology is a huge part of the employees’ day. Using slow, outdated systems with frequent problems makes it much more difficult for them to be happy and productive. How would it impact a business if the company enabled the employees to get just 5 percent more accomplished every day? the answer is simply by keeping the technology up to date. So, the problem exposed above allows the company to find new ways and opportunities to make the job easier. The company would need to establish a training plan for the employees. Maybe establishing a diploma course that allows them to learn and know better the new technologies.</span>
4 0
3 years ago
You can reduce the size or minimize the Ribbon. *
Vinvika [58]

Answer:

minimize

Explanation:

5 0
3 years ago
Other questions:
  • A typical, small, dry cell battery has a voltage of A. 6.0 volts. B. 1.0 volts. C. 12.0 volts. D. 1.5 volts.
    11·2 answers
  • Because public key encryption requires the use of two different keys, it is also known as _____ encryption
    13·1 answer
  • In the accompanying figure, the split double arrow mouse pointer____.
    7·1 answer
  • What is an objective of state-sponsored attackers?
    11·1 answer
  • A _______ template is used to maintain consistency in terms of margins and page numbers .
    6·1 answer
  • The average numbers of shares a piece of content receives is known as its:
    7·1 answer
  • Besides your computer, where else can you find and use an operating system?
    11·1 answer
  • The economic importance of computer viruses​
    14·2 answers
  • Common names for computer-based information systems are transaction processing, management information, ________, and executive
    5·1 answer
  • What are 2 ways to send a message to your client when signed in as an accountant user?.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!