Question
C++ Programming Question. Please follow the guidelines. You have recently collected reviews from four movie reviewers where the reviewers are numbered 1- 4. Each reviewer
C++ Programming Question. Please follow the guidelines.
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. In the main function 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).
Important Note.......
(1) When a multidimensional array parameter is passed through a function declaration (prototype) and corresponding function heading (definition), the size of the first dimension is not given, but the remaining dimension sizes must be given in square brackets. The assumption here is that the array dimension sizes (integer values) have been declared either globally or locally.
(2) Arrays passed in function declaration (prototype) or function heading (definition) parameter lists are reference parameters by default. Depending on the algorithm and purpose of an array processing related function you may choose to add the keyword const to any function related array parameter to prevent any accidental writing to the originial array from within the function definition. The following are two examples of function declarations or prototypes with a two-dimensional array parameter someArray, const int NUM_ROWS=4,NUM_COLS=6; // global constants for array size declarations //function prototypes or declarations void getRatings(int someArray [][NUM_COLS]); //the array is passed by reference to the function with read/write access void showRatings(const int someArray [][NUM_COLS]); //the array is passed by reference to the function but with read only access * note: since NUM_ROWS (the first dimension) is delcared as a global constant, a second int parameter to pass number of rows to each of the above functions is not needed.
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
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