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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started