Question: Problem 3. Olympics Medal Table (30 points) In Olympics, rank in medal table is decided using some specific rules. If a country has more gold

 Problem 3. Olympics Medal Table (30 points) In Olympics, rank inmedal table is decided using some specific rules. If a country has

Problem 3. Olympics Medal Table (30 points) In Olympics, rank in medal table is decided using some specific rules. If a country has more gold medals than other, then its rank is higher; even if others have higher silver or bronze medals. If number of gold medals are equal for them, then silver medals come into account, irrespective of bronze medals. If both gold and silver medals are in same quantity, number of bronze medals are used for ranking. If all the medals are in equal number, then these countries are place in alphabetical order in the medal table. Suppose, you are asked to create a system that prints the medal table of Olympic with 2 countries. Your input would be those 2 countries name, their gold, silver and bronze medal quantities. Write a program that prints out the medal table of the Olympics in ascending order of rank; following the mentioned rules. Define a structure type which holds the name, medal quantities and rank of the country. You can use 2 structure type variables or an array of structure with 2 elements. Take the input into structure using proper techniques. Use conditional statements for deciding the rank. You might want to swap variables or print the rank after each conditions. Check this link for input-output: https://www.programiz.com/c-programming/examples/structure-store-information Sample Input and Output: (Your code should print the red texts on the screen. Black texts are sample user inputs)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!