In the same file, complete the following exercises in theauthor’s pseudocode as presented in the
text book and material on Blackboard in this chapter, and followingall requirements for good
program design that were shown in Chapter 2 and all examples sincethen.
At the Summer Olympic Games every four years, for historicalreasons, athletes represent
National Olympic Committees (NOCs) rather than strictly countries.For the sake of convenience
in our program, let us refer to them simply as “nationsâ€. As of the2016 Rio Olympics, then,
there were 206 nations eligible to participate in the Olympics.Write a program that could be
used to represent the medal table for the next Olympics that willbe held in Tokyo in 2020. Since
we do not know how many nations will actually participate, ourprogram will have to plan on
there being a maximum of 225 nations (in case some more NOCs arerecognized before the 2020
Olympics), but must adapt to fewer nations actually being present.So, write a program that
1. Allows a user to enter
a. The names of the nations that are participating
b. The number of gold medals that nation has won
c. The number of silver medals it has won
d. The number of bronze medals it has won
e. “ZZZ†as the nation’s name to indicate that they have finishedentering input
2. Outputs a list of sentences that describe each nation’sperformance, e.g., for the 2016
Olympics, to describe the performance of the United States, thisprogram would have
output “United States won 46 gold, 37 silver, and 38 bronze
medals, for a total of 121 medals†. Below this list, the programmust
output the total number of gold medals awarded, silver medalsawarded and bronze
medals awarded, and total of all medals awarded.
3. Scans for and outputs
a. The names of the nations with the most and least gold medals,along with their
gold medal counts, e.g., “United States won the most gold
medals: 46â€
b. Similarly, the names of the nations with the most and leastsilver and bronze
medals respectively
4. Allows the user to enter the name of a nation that they wantto search for, and if it finds
that nation, outputs a sentence in the format shown in #2above.
All of the above must be done by applying the concepts andalgorithms shown in Chapter 6, both
in the text book and in the material provided on Blackboard, andbuilding on what we have
learned in all the chapters before this one.
The only data that this program stores is the names of thenations, and the matching counts of
gold, silver and bronze medals. All calculations and scanning forhighest and lowest, etc., must
be done by the program after the user has entered the sentinel toindicate the end of their input.
All output sentences described above must be generated when theyare required.
Book this is from is \"Programming Logic and Design 8th Edition\"by: Joyce Farrell. Must be written in pseudocode that resemblesthat in the book.
this is what I have so far. It probably isn't right, but it willat least give you some structure to follow. Any help isappreciated.
Start
  Declarations
     string EXIT = ZZZ
     NATION_CAPACITY = 225
     stringNATION_NAME[NATION_CAPACITY]
     num goldMedals
     num silverMedals
     num bronzeMedals
     num totalMedals
     num count
     num nextNation
     num mostGold
     num leastGold
     num mostSilver
     num leastSilver
     num mostBronze
     num leastBronze
  output \"Welcome to our Medal TrackerProgram.\"
  output \"This program will allow the user to enter thename of nations participating in the olympics, allow
     the user to enter the number ofgold, silver, and bronze medals that nation has won.\"
  output \"Please enter the name of the first nation(type \", ZZZ, \" to stop): \"
  input nextNation
  count = 0
 Â
  while nextNation <> ZZZ AND count      NATION_NAME[NATION_CAPACITY] =nextNation
     output \"Please enter the amountof gold medals this nation has won: \"
     input goldMedals[count]
     output \"Please enter the amountof silver medals this nation has won: \"
     input silverMedals[count]
     output \"Please enter the amountof bronze medals this nation has won: \"
     input bronzeMedals[count]
     count = count + 1
     output \"Please enter the nextnation or \", ZZZ, \" to stop: \"
     input nextCustomerID
  endwhile
  output \"You entered data for \", count, \"nations.\"
  totalMedals = goldMedals + silverMedals +bronzeMedals
  output \"The nation \", nextNation, \" won \",goldMedals, \" gold medals, \", silverMedals, \" silver medals, and \",bronzeMedals, \"
     bronze medals, for a total of \",totalMedals, \" medals.
  mostGold =