Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include using namespace std; int main() { const int SIZE = 6; //number of movies const string GAMES[] = {The Matrix, Fight Club, Spirited

 #include  #include  using namespace std; int main() { const int SIZE = 6; //number of movies const string GAMES[] = {"The Matrix", "Fight Club", "Spirited Away", "Alien", "Seven Samurai", "Back to the Future"}; double ratings[SIZE]; double total = 0, average; int highest_index = 0; //Prompt the user for movie ratings cout << "Please enter a rating for the following movies:" << endl; for(int i = 0; i < SIZE; i++) { cout << GAMES[i] << " : "; // TODO: Take user input for movie rating HERE } // TODO: Determine the average rating // TODO: Determine the index of the movie with the highest rating cout << fixed << setprecision(1) << "Average rating : " << average << endl << "Highest rating : " << ratings[highest_index] << " rated " << GAMES[highest_index] << endl; return 0; }

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

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions