Provide details on what you need help with along with a budget and time limit. Questions are posted anonymously and can be made 100% private.
Match with a Tutor
Studypool matches you to the best tutor to help you with your question. Our tutors are highly qualified and vetted.
Get Quality Help
Your matched tutor provides personalized help according to your question details. Payment is made only after you have completed your 1-on-1 session and are satisfied with your session.
Page: 1
COP1000 Fall 2021
•
HW5 (also Final Exam Practice)
11/25/2021
Problem statement: You have been asked to design a modular program using Java which
summarizes results for a poll of favorite movie from a list of highest grossing movies. The program
uses arrays (with a maximum of 10 elements) to store the following information for each movie:
•
•
•
name
year released
total number of votes
Design a function to load the movie data which accepts the movie names array and years released
array as parameters and returns the number of movies loaded. The function loads the arrays with
the following data:
Name
Avengers: Endgame
Avatar
Titanic
Year Released
2019
2009
1997
After the program calls the function to load the movie data, the program repeatedly prompts the
user to enter a number to vote for one of the movies or to finish. Validate this numeric input. Add a
vote for the chosen movie and store in the total vote array.
After the input is complete, display a summary of the movie names, years released, and total
number of votes for each movie.
Finally, display the name of the movie(s) that received the most votes.
•
Storyboard: Assuming the movie data had three (3) movies named Avengers: Endgame, Avatar, and
Titanic the program’s input and output would look like the following. The first prompt is:
Please enter your vote as follows:
Enter 1 for Avengers: Endgame
Enter 2 for Avatar
Enter 3 for Titanic
Enter 4 when voting is finished
Page: 2
After the user enters a value, redisplay the prompt:
Please enter your vote as follows:
Enter 1 for Avengers: Endgame
Enter 2 for Avatar
Enter 3 for Titanic
Enter
4 when
voting
is finished
Please
enter your
vote
as follows:
2Enter 1 for Avengers: Endgame
Please
your vote as follows:
Enter enter
2 for Avatar
Enter
Enter13for
forAvengers:
Titanic Endgame
Enter
Avatar
Enter24for
when
voting is finished
Enter
2 3 for Titanic
Enter
4 when
voting
is finished
Please
enter your
vote
as follows:
1Enter 1 for Avengers: Endgame
Please
your vote as follows:
Enter enter
2 for Avatar
Enter
Enter13for
forAvengers:
Titanic Endgame
Enter
2
for
Avatar
Enter 4 when voting is finished
Enter 3 for Titanic
Enter 4 when voting is finished
3
Please enter your vote as follows:
Enter 1 for Avengers: Endgame
Enter 2 for Avatar
Enter 3 for Titanic
Enter 4 when voting is finished
1
Please enter your vote as follows:
Enter 1 for Avengers: Endgame
Enter 2 for Avatar
Enter 3 for Titanic
Enter 4 when voting is finished
4
After all the votes are entered as follows:
The report generated would look like the following:
1.
Movie
Year Released
Avengers: Endgame
2019
Avatar
2009
Titanic
1997
Avengers: Endgame is the winner!
Votes
2
1
1
Purchase answer to see full
attachment
Would you like to help your fellow students? Are you in need of an additional source of income? Apply to become a tutor on Studypool! Our best tutors earn over $7,500 each month!