Write a program RottenTomatoes.java that creates a 2 dimensional integer array of movie ratings from the command line arguments and displays the index of the movie that has the highest sum of ratings. Ratings range from 1 to 5 (inclusive). The rows of the 2D array correspond to movie reviewers and the columns of the 2D array correspond to movies. The reviewer at index 2 gave movie at index 0 a rating of 4. Take a look at the following example for an explanation on the command line arguments sequence.   The first argument corresponds to the number of reviewers and the second argument corresponds to the number of movies (the dimensions of the 2D integer array). Following are the movie ratings in a row-major order. This means that the first row is filled first, then the second row, etc. In the example above there are 3 reviewers and 2 movies, and the program displays 0 (zero) because the movie at index zero has the highest sum of ratings (movie 0 has sum of ratings equals to 12 while move 1 has sum of ratings equals to 6). Note 1: assume that the order of the first two input arguments are the number of rows and the number of columns. Note 2: assume that there are enough arguments to completely fill the 2D array. Note 3: if multiple movies have the same highest sum of ratings, display the movie with the lowest index.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
  1. Write a program RottenTomatoes.java that creates a 2 dimensional integer array of movie ratings from the command line arguments and displays the index of the movie that has the highest sum of ratings. Ratings range from 1 to 5 (inclusive). The rows of the 2D array correspond to movie reviewers and the columns of the 2D array correspond to movies. The reviewer at index 2 gave movie at index 0 a rating of 4. Take a look at the following example for an explanation on the command line arguments sequence.
 
    • The first argument corresponds to the number of reviewers and the second argument corresponds to the number of movies (the dimensions of the 2D integer array). Following are the movie ratings in a row-major order. This means that the first row is filled first, then the second row, etc.
    • In the example above there are 3 reviewers and 2 movies, and the program displays 0 (zero) because the movie at index zero has the highest sum of ratings (movie 0 has sum of ratings equals to 12 while move 1 has sum of ratings equals to 6).
    • Note 1: assume that the order of the first two input arguments are the number of rows and the number of columns.
    • Note 2: assume that there are enough arguments to completely fill the 2D array.
    • Note 3: if multiple movies have the same highest sum of ratings, display the movie with the lowest index.
**Transcription and Explanation for Educational Website**

---

**Text Transcript**

```
java RURottenTomatoes 3 2 5 2 3 3 4 1 0
```

**Graph/Diagram Explanation**

The image consists of a command and an example illustrating a two-dimensional array used to represent movie ratings by different reviewers.

- **Command Explanation**
  - `java RURottenTomatoes 3 2 5 2 3 3 4 1 0`
    - **java**: Indicates this is a Java command.
    - **RURottenTomatoes**: Presumably the name of the Java program or class being executed.
    - **3**: Represents the number of reviewers (rows) in the data.
    - **2**: Represents the number of movies (columns) being reviewed.
    - The numbers `5, 2, 3, 3, 4, 1` are the ratings given by each reviewer.
    - `0`: An indicator that marks the end of input or represents a command option.

- **Table/Dataset Explanation**

The table shown below the command illustrates how the ratings are distributed among reviewers and movies:

- **Rows** represent the reviewers (3 reviewers as indicated by the '3' in the command).
- **Columns** represent the movies (2 movies as indicated by the '2' in the command).

**Ratings Table:**

|   | Movie 0 | Movie 1 |
|---|---------|---------|
| Reviewer 0 |    5    |    2    |
| Reviewer 1 |    3    |    3    |
| Reviewer 2 |    4    |    1    |

- **Reviewer 0** rated Movie 0 as 5 and Movie 1 as 2.
- **Reviewer 1** rated both Movie 0 and Movie 1 as 3.
- **Reviewer 2** rated Movie 0 as 4 and Movie 1 as 1.

This representation is useful for organizing and analyzing ratings data, especially in software applications related to movie reviews or recommendations.
Transcribed Image Text:**Transcription and Explanation for Educational Website** --- **Text Transcript** ``` java RURottenTomatoes 3 2 5 2 3 3 4 1 0 ``` **Graph/Diagram Explanation** The image consists of a command and an example illustrating a two-dimensional array used to represent movie ratings by different reviewers. - **Command Explanation** - `java RURottenTomatoes 3 2 5 2 3 3 4 1 0` - **java**: Indicates this is a Java command. - **RURottenTomatoes**: Presumably the name of the Java program or class being executed. - **3**: Represents the number of reviewers (rows) in the data. - **2**: Represents the number of movies (columns) being reviewed. - The numbers `5, 2, 3, 3, 4, 1` are the ratings given by each reviewer. - `0`: An indicator that marks the end of input or represents a command option. - **Table/Dataset Explanation** The table shown below the command illustrates how the ratings are distributed among reviewers and movies: - **Rows** represent the reviewers (3 reviewers as indicated by the '3' in the command). - **Columns** represent the movies (2 movies as indicated by the '2' in the command). **Ratings Table:** | | Movie 0 | Movie 1 | |---|---------|---------| | Reviewer 0 | 5 | 2 | | Reviewer 1 | 3 | 3 | | Reviewer 2 | 4 | 1 | - **Reviewer 0** rated Movie 0 as 5 and Movie 1 as 2. - **Reviewer 1** rated both Movie 0 and Movie 1 as 3. - **Reviewer 2** rated Movie 0 as 4 and Movie 1 as 1. This representation is useful for organizing and analyzing ratings data, especially in software applications related to movie reviews or recommendations.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education