Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started