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
PLEASE help me RIGHT NOW!!!!!!!!! I will give a Brainly to anyone who helps me!
dybincka [34]
I am deeply sorry for the experience that you have received, I am disappointed in myself for letting this happen. If it would be possible I would like to make it up to you. Again, I am deeply sorry that this happened. 
Sincerely *enter full name*

I am not sure if you have any multiple choice options but I hope this works xx
8 0
3 years ago
What are the four steps of the research process?
pishuonlain [190]

Answer:

Step 1: Identify the Problem

Step 2: Review the Literature. ...

Step 3: Clarify the Problem Step 4: Clearly Define Terms and Concepts.

7 0
3 years ago
____ is a practice where a user in enticed by possible rewards and then asked to provide personal information.
Alina [70]
Baiting is the answer
Hope it helped!
8 0
3 years ago
in which of the following scenarios would a router send a resign message? answer if a preempted active router fails, the standby
hodyreva [135]

A scenario in which a router would send a resign message include the following: A. if a preempted active router fails, the standby router becomes the active router. If the preempted active router regains service, it sends a coup message. The current active router sends the resign message after receiving the coup message.

<h3>What is a router?</h3>

In Computer technology, a router can be defined as a network device (node) that is designed and developed to connect two (2) different computer networks together, in order to allow them communicate by forwarding and receiving encapsulated data (Ethernet frame) and packets.

<h3>What is a resign message?</h3>

In Computer networking, a resign message can be defined as a set of information that is typically sent by an active Hot Standby Router Protocol (HSRP) network device when it is preparing to go offline or whenever it wants to relinquish the active role due to some other reasons.

This ultimately implies that, a resign message instructs or informs a standby router to get ready to become the active router and take over the active role.

Read more on router here: brainly.com/question/24812743

#SPJ1

8 0
1 year ago
F1: 2^14 formula ....................................................................
QveST [7]

Answer:

=POWER(2,14)

Explanation:

The complete question is to write the given formula in cell F1

We have:

F1 = 2^\wedge {14}

The above formula implies 2 raised to the power of 14.

In Excel, this can be achieved using the power function

And the syntax is:

=POWER(m,n)

which means m^n

So, 2^14 will be entered in cell F1 as:

=POWER(2,14)

4 0
3 years ago
Other questions:
  • Progressively enhancing a web page for different viewing contexts (such as smartphones and tablets) through the use of coding te
    11·1 answer
  • On the CallCenterReport worksheet, add formulas that will summarize the issues for the department entered in cell B3. In cell B6
    13·1 answer
  • Signs that a listener is paying attention include:
    10·2 answers
  • A user who has special security and access to a system, such as the right to assign passwords, is called a ____.​ a. ​ technical
    8·1 answer
  • Colin Mackay Inc., a software company with its head office in Amsterdam, has employees across three continents. Certain project
    11·1 answer
  • Which of the following pieces of evidence was NOT used to support the Theory of Continental Drift?
    10·1 answer
  • Which of the following are used to classify plutons
    14·1 answer
  • 8.10 quiz edhesive A swap is: a variable used to find the smallest value in an array an algorithm used to find a value in an arr
    12·1 answer
  • What might a designer need to consider when choosing an appropriate energy source for products and power systems
    15·1 answer
  • A.m. client appears at the top of every page
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!