COP 1000 Modular Program in Java Project

User Generated

ncenqrrc92

Programming

COP 1000

COP

Description

Unformatted Attachment Preview

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
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

View attached explanation...


Anonymous
Just the thing I needed, saved me a lot of time.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Similar Content

Related Tags