Question: JAVA Programming Language Question 1: Nested Loops: You are organising a 21m birthday party for your best friend. At the party, the DJ allows the

JAVA Programming Language

Question 1: Nested Loops: You are organising a 21m birthday party for your best friend. At the party, the DJ allows the guests to vote for their favourite songs, and the last song of the party is the most popular song. The DJ will give a list of five songs to ten random guests and ask them to choose their favourite song. The song which receives the most votes will be the most popular song. If there is more than one song which receives the most votes, then any of the most popular songs can be played as the final song of the night.

Write a program that will complete the following tasks:

1. Show each of the 10 users user a list of all the five songs and ask them to choose their favourite. 2. Store the votes for the songs in an array, where the first element of the array in the number of votes for the first song, and so on. 3. Determine the most popular song. 4. Print out the most popular song and the number of votes for the most popular song. If more than one song is voted the most popular, then any of them may be printed out.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!