Question: Write a java program to ask people's preferences on a favorite tv show and compute statistics and display the results. Rate the item from 1
Write a java program to ask people's preferences on a favorite tv show and compute statistics and display the results.
Rate the item from 1 (least preferred) to 10 (most preferred). You must use at least one enhanced for statement. Please use a separate method to compute and display the results instead of implementing all the code in the main method. The method must have at least one parameter of an array that includes the user input.
Example input and output:
Enter the number of responses: 2
Enter response 1 for Friends:3
Enter response 1 for The Voice: 4
Enter response 1 for American Idol: 7
Enter response 1 for The Office: 8
Enter response 1 for Glee: 10
Enter response 2 for Friends:1
Enter response 2 for The Voice: 5
Enter response 2 for American Idol: 9
Enter response 2 for The Office: 4
Enter response 2 for Glee: 3
Statistics of the responses
Response 1 Response 2 Average Total
Friends . 3 1 2 4
The Voice 4 5 4.5 9
American Idol 7 9 8 16
The Office 8 4 6 12
Glee 10 3 6.5 13
The tv show with the highest point: American Idol, 16
The tv show with the lowest point: Friends, 4
You must add appropriate comments in your code as below, generate javadocs, and submit html files together with your source code.
Add class level javadoc comment with @author tag and description about the class.
Add method level javadoc comments with @param and @return (if your method returns a value) tags with the description of the method, parameters, and return value.
In the methods, please add end-of-line or block comments whenever necessary to help others understand your code
DO NOT add comments such as // end of method, // end of class. you have to explain what your application does. Please make sure the java documents you generated contains your javadoc comments properly.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
