The El Cajon Parks District maintains five soccer teams, as shown in the table b
ID: 673607 • Letter: T
Question
The El Cajon Parks District maintains five soccer teams, as shown in the table below. Write the pseudocode for a program that accepts a player’s team number as the player registers to be on the team and displays the player’s team name continuously until an appropriate sentinel value is entered for a team number. In addition, after the sentinel value has been entered, the program displays (output) a count of the number of players registered for each team along with the team number and the team name. Be sure to use Modules!
Team Number
Team Name
1
Goal Getters
2
The Force
3
Top Guns
4
Shooting Stars
5
Midfield Monsters
Team Number
Team Name
1
Goal Getters
2
The Force
3
Top Guns
4
Shooting Stars
5
Midfield Monsters
Explanation / Answer
//player list is a list of structure which contains player's name and team number
struct playerList{
teamNumber;
playerName
}
function Team(teamNumber , teamNameList , playerLst){
sentinel = n
loop until sentinel = n:
print teamNameList[teamNumaber]
input sentinel
end of loop
loop from i = 1 to 5:
print i , TeamNameList[i] , countOfPlayers(i,playerList)
end loop
}
//Function will return total numaber of player in perticular team
function countOfPlayers(teamNumber , playerList){
count = 0
loop through playerList:
if(playerList.teamNumber == teamNumber)
count++
end if
end loop
return count
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.