Question

Programming Logic and Design Comprehensive (6th Edition) Chapter 6, Exercise 4

4.

a. The Midville Park District maintains five soccer teams, as shown in the table. Design a program that accepts a players team numbers and displays the player's teamname.

b. Modify the Midville Par District program so that after the last player has been entered, the program displays a count of the number of players registered for eachteam.

Table:
Team Number Team Name
1 Goal Getters
2 The Force
3 Top Guns
4 Shooting Stars
5 Midfield Monsters
1 0
Add a comment Improve this question Transcribed image text
Answer #1
Dear,
a.

Pseudocode to accept a player’s team number and display the player’s team name:

start

   Declartions

      num item

      num SIZE = 5

      num sub

      num team_number[SIZE] = 1,2,3,4,5

      num FINISH=999

      string team_name[5] = “Goal Getters”,”The Force”,”Top Guns”,

                                                 ”Shooting Stars”,”Midfield Monsters”

      getReady()

      while item <> FINISH

         findName()

     endwhile

     finish()

stop

getReady()

   output “Enter Team Number “

   input item

return

findName()

sub = 0

while sub < SIZE

    if item = team_number[sub] then

         output “The player’s team name is ” ,team_name[item]

    endif

   sub =sub +1

endwhile

return

finishUp()

   output “End of job”

return
Flow chart:
b.   Pseudocode to count of the number of players registered for each team:

start

   Declartions
      num i
      num SIZE = 5
      num item[SIZE]
      num count
      num FINISH=999
      num team_number[SIZE] = 1,2,3,4,5
      string team_name[5] = “Goal Getters”,”The Force”,”Top Guns”,

                                                          ”Shooting Stars”,”Midfield Monsters”

     getReady()
        while item <> FINISH
          findName()
        endwhile
        finishUp()
stop
getReady()
   for count = 0 to 4 step 1
      output “Enter Last Team Number “
       i=0
      input item[i]
      i++;
    endfor
return

findName()

for count = 0 to 4 step1
     i = 0;
    output “The total number of players registered for each team”,item[i]
endfor

finishUp()

   output “End of job”

return
Add a comment
Know the answer?
Add Answer to:
Programming Logic and Design Comprehensive (6th Edition) Chapter 6, Exercise 4
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Need done in C++ Can not get my code to properly display output. Instructions below. The...

    Need done in C++ Can not get my code to properly display output. Instructions below. The code compiles but output is very off. Write a program that scores the following data about a soccer player in a structure:            Player’s Name            Player’s Number            Points Scored by Player      The program should keep an array of 12 of these structures. Each element is for a different player on a team. When the program runs, it should ask the user...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT