Question: Two-dimensional array operations in C++ : Movie Ratings program ** You have recently collected reviews from four movie reviewers where the reviewers are numbered 1-
Two-dimensional array operations in C++ : Movie Ratings program**
You have recently collected reviews from four movie reviewers where the reviewers are numbered 1- 4. Each reviewer has rated six movies where the movies are numbered 100 -105. The ratings range from 1 (terrible) to 5 (excellent).
Note: To store the sample data below in a 2D array the reviewer numbers must be mapped to 0-3 (row subscript or index) and the movie IDs must be mapped to 0-5 (column subscript or index). The movie rating does not include data for unrated movies and only includes values related to the rating range provided. A sample data set with movie review ratings are shown in the following table:
| 100 | 101 | 102 | 103 | 104 | 105 | |
| 1 | 3 | 1 | 5 | 2 | 1 | 5 |
| 2 | 4 | 2 | 1 | 4 | 2 | 4 |
| 3 | 3 | 1 | 2 | 4 | 4 | 1 |
| 4 | 5 | 1 | 4 | 2 | 4 | 2 |
Based on this information your program should allow the user a menu of 6 options. The options are:
Display current movie ratings.
Show the average rating for each movie.
Show a reviewers highest rated movie. (enter reviewer# 1-4)*
Show a movies lowest rating. (enter movie# 100-105)
Enter new ratings (1-5) for movie# 100-105 for four reviewers.
Exit the program.
*If a reviewer has rated multiple movies with the same highest rating, display all the movie numbers with the same highest rating in your output (this maybe on a single line or on multiple lines and would depend on how you have written the procedure in the function that is called for option#3). Points will not be deducted if it does not match the sample output below, but I must see all the movie numbers listed if there are multiple movies with the same highest rating.
The size or dimensions of the array should be declared as two global constants. You must first set-up, initialize or store the sample reviewer rating data (see table above) in a two dimensional array. This is to ensure that valid data exists in the 2-D array in case the user chooses options 1 - 4 before exiting the program.
Each option in the menu must call a function. Each function must at minimum pass in a two dimensional array and the parameter type must contain a size declarator for the number of columns (see Gaddis text Chapter#8, page 549). Note: When a multidimensional array parameter is given in a function heading or function declaration, the size of the first dimension is not given, but the remaining dimension sizes must be given in square brackets. Since the first dimension size is not given, you usually need an additional parameter of type int that gives the size of this first dimension. The following are two examples of function declarations or prototypes with a two-dimensional array parameter someArray, void getRatings(int someArray [][100], int numRows); //the array is passed by reference to the function with read/write access void showRatings(const int someArray [][100], int numRows); //the array is passed by reference to the function but with read only access
You may use the partial program framework provided below as an initial set-up guide to begin writing your own algorithms or you may start entirely with your own approach and implement the necessary interface to this programming project. The requirement is that I see well-documented seperate function procedures that are called when menu options 1-5 are selected and that the function algorithms process the 2-D array data correctly.
The program run-time output shown below is based on compiling the program to test each menu option. Use this as a guide while you write and test your programs interface and calls to specific function procedures.
Use meaningful identifiers and include function documentation (see syllabus) particularly in the function header and elsewhere in the function body where appropriate. Credit is provided only for those function procedures that correctly process the array data based on the option selected.
Prior to submission make sure that you compile and test each option in your program to ensure that the output is similar to the sample program ouput shown below. There will be no redo on this project.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
