Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The one - dimensional ( 1 D ) array TeamName [ ] contains the names of teams in a sports league. The two - dimensional
The onedimensional D array TeamName contains the names of teams in a sports league.
The twodimensional D array TeamPoints contains the points awarded for each match.
The position of each teams data in the two arrays is the same. For example, the team stored at
index in TeamName and TeamPoints is the same.
The variable LeagueSize contains the number of teams in the league. The variable MatchNo
contains the number of matches played. All teams have played the same number of matches.
The arrays and variables have already been set up and the data stored.
Each match can be played at home or away. Points are recorded for the match results of each
team with the following values:
away win
home win
drawn match
lost match.
Write a program that meets the following requirements:
calculates the total points for all matches played for each team
counts the total number of away wins, home wins, drawn matches and lost matches for each
team
outputs for each team:
name
total points
total number of away wins, home wins, drawn matches and lost matches
finds and outputs the name of the team with the highest total points
finds and outputs the name of the team with the lowest total points.
You must use pseudocode and add comments to explain how your code works.
You do not need to declare any arrays, variables or constants; you may assume that this has
already been done.
All inputs and outputs must contain suitable messages.
You do not need to initialise the data in the arrays TeamName and TeamPoints or the
variables LeagueSize and MatchNo
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