Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write this code in Java and observe the rules above. Thanks. Observe the following rules: DO NOT add any import statements DO NOT add

image text in transcribedimage text in transcribed

Please write this code in Java and observe the rules above. Thanks.

Observe the following rules: DO NOT add any import statements DO NOT add the project statement DO NOT change the class name DO NOT change the headers of ANY of the given methods DO NOT add any new class fields DO NOT use System.exit() ONLY print the result as specified by each problem. DO NOT print other messages, follow the examples for each problem. RU Rotten Tomatoes (30 points). Write a program RURotten Tomatoes.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. Number of movies (columns) Number of reviewers (rows) java RURotten Tomatoes 3 2 5 2 3 3 4 1 0 0 1 0 5 2 1 3 3 2 4 1 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 o 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. o Note 3: if multiple movies have the same highest sum of ratings, display the movie with the lowest index

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions