Question: Write a program that prompts the user to enter in a number of teams to work with. Then create an array of the team names

Write a program that prompts the user to enter in a number of teams to work with.

Then create an array of the team names which will be gathered from prompts and another array of the team wins which will be random numbers between 0 and 25.

For example:

How many teams?

5

NOTE: Make sure you display the number in the prompt

What is team 1's name?

BYU

What is team 2's name?

Gonzaga

Repeat this process for all of the teams. Then search through the array using a FOR Loop to find which team had the most wins. Then print out the team name and the number of their wins.

HOWEVER, if the user did not enter a valid number of teams, ONLY display an alert box that says "No teams to display" instead of all of the other output.

For example:

BYU had the most wins with a record of 24-1

NOTE: if there is a tie, whichever team you find first is considered first place.

If there is data to display then display all of the teams and their records in a single alert box displaying the team name and the record on one line and then separating each of the team info using the new line character " ".

For example:

BYU 24-1

USU 10-15

WSU 16-9

UofU 12-13

Here are some sample screens:

Write a program that prompts the user to enter in a number

of teams to work with. Then create an array of the team

names which will be gathered from prompts and another array of the

team wins which will be random numbers between 0 and 25. For

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!