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:
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