subject

Create a java program to store and process movie ratings. use a 2d array to store ratings by different reviewers for different movies. each row represents a different movie and each column represents a different reviewer. there will also be two separate arrays to store the names of movies and the names of the reviewers. you may use the attached uml diagram to base information off of and the test program code at the bottom to test it. movieratings()constructor for the classone parameter is an array of reviewers namesone parameter is an array of movie namesdescription: set the parameters equal to the private data members for the movies and reviewers; initialize the 2d ratings array based on the size of the reviewers array (rows) and the size of the movies array (columns)getavgrating()returns a double value representing the average ratingdescription: find the average rating for all movies and all reviewers (i. e. all data in the table)getavgratingsbymovie()one parameter, the index of the movie to find all the reviews forreturns a double value representing the average ratingdescription: find the average rating for a single movie (i. e. one column representing all the reviewers scores for that one movie)getavgratingsbyreviewer()one parameter, the index of the reviewer to find all the reviews forreturns a double value representing the average ratingdescription: find the average rating for a single reviewer (i. e. one row representing all the movies for that one reviewer)getmovieindex()one parameter, the name of the moviereturns an integer representing the index number of that moviedescription: searches the movies array to find the index location for that movie. this can then be used to find the ratings for that movie in the ratings 2d arraygetreviewerindex()one parameter, the name of the reviewerreturns an integer representing the index number of that reviewerdescription: searches the reviewers array to find the index location for that reviewer. this can then be used to find the ratings for that reviewer in the ratings 2d arraysetrating()one parameter each for the movie index, for the reviewer index and for the rating to storedescription: the reviewer index specifies the row, the movie index specifies the column and the rating is the value to store in that cellprintmovieratings()one parameter that represents the index of the movie name and the movie ratingsdescription: prints the movie name and the ratings to system. outexample: "the lego movie: 5, 6, 2, 7, 8"printreviewerratings()one parameter that represents the index of the reviewers name and their movie ratingsdescription: prints the reviewer name and the ratings to system. outexample: "roger ebert: 4, 2, 8, 9"test program code: public class movieratingstest{ public static void main(string args[]) { string[] movies = {"gravity", "12 years a slave", "spaceballs"}; string[] reviewers = {"jen", "bino", "sophia"}; movieratings ratings = new movieratings(reviewers, movies); //give some values for the ratings for(int i = 0; i

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 21:30, Cheflulu5727
Write a function named printfloatrepresentation(float number) that will print the floating point representation of a number using the format given below. (sign bit) exponent in binary (assumed bit).significandfor example if the number passed an argument is 71 yourprogram should print (0) 10000101 (1).00011100000000000000000similarl y if the number passed to the function as argument is -71 the program should print (1) 10000101 (1).00011100000000000000000
Answers: 3
image
Computers and Technology, 23.06.2019 03:10, nxusasmangaliso8780
Fill in the following program so that it will correctly calculate the price of the orange juice the user is buying based on the buy one get one sale.#include //main functionint main() { int cartons; float price, total; //prompt user for input information printf("what is the cost of one container of oj in dollars? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & price); printf("how many containers are you buying? \n"); scanf(" [ select ] ["%d", "%c", "%f", "%lf"] ", & cartons); if ( [ select ] ["cartons / 2", "cartons % 1", "cartons % 2", "cartons % price", "cartons / price", "cartons / total"] [ select ] ["=", "==", "! =", "< =", "> =", "< "] 0) total = [ select ] ["price * cartons", "cartons * price / 2 + price", "(cartons / 2) * price", "cartons / (2.0 * price)", "(cartons / 2.0) * price + price", "((cartons / 2) * price) + price"] ; else total = ((cartons / 2) * price) + price; printf("the total cost is $%.2f.\n", total); return 0; }
Answers: 2
image
Computers and Technology, 23.06.2019 05:00, bellad0124outlookcom
In cell b18, enter a formula to calculate the amount budgeted for meals. this amount is based on the daily meal allowance and the total travel days (# of nights+1).
Answers: 1
image
Computers and Technology, 23.06.2019 09:20, lovely222
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
You know the right answer?
Create a java program to store and process movie ratings. use a 2d array to store ratings by differe...

Questions in other subjects:

Konu
Mathematics, 21.09.2019 21:00