Question: #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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
