CS 115 Project 1, Fall 2016:
Olympic Medal Tally System


Summary: In this project, you will write a program to compute some statistics demonstrating performance of a country in Olympics Games. The user of your program is interested in figuring out the number of medals a specific country won and the relative success of the different sports it represented in Olympics.

Your program will ask the user to enter the name of the country for which statistics needs to be computed. Thereafter, it will query the numbers of sports that country participated in and the number of medals won in each sport. The program will compute total number of medals and a "weighted score" that gives higher importance to Gold medal followed by Silver and then Bronze. Secondly, based on the number of participants in a sport, a "success rate" will also be computed. Lastly, the program will determine which sport did the country do best in based on different metrics.

Due dates:


Checkpoint A (10 points)

For Checkpoint A, you will need to demonstrate a program that does the following:

  1. Welcomes user to the Olympic Medal Tally system.
  2. Prompts the user to enter the name of country (for which statistics need to be computed).
  3. Prompts the user to enter the number of sports in which this country participated. You can assume that the user always enters a positive integer (greater than zero).
  4. Prompts the user to enter the name of each sport.
  5. Prompts the user to enter the number of medals( gold, silver, bronze) won. You can assume that the user always enters an integer that is equal to or greater than zero.
  6. Prints out the total number of medals won for each sport.
  7. Prints out a weighted score that weighs the number of medals according to this formula:
  8. Repeats steps 4-7 for each sport
  9. Prints out overall statistics showing the number of sports in which atleast one medal was won, number of sports in which no medal was won, total number of medals the country won and an average number of medals won per sport.

NOTE: Your program's spelling, capitalization, and punctuation will need to match the sample output EXACTLY for this project.

NOTE: All floating-points need to be rounded to 3 decimal points. Let's say, you want to round-off a float called val then you may use round(val,3)

Here is some sample input and output. Throughout this specification, sample user input is in green and the remaining is the output of the program.

Checkpoint A - Sample 1

Example of output by the end of completing checkpoint A

Checkpoint A - Sample 2

Example of output by the end of completing checkpoint A

Checkpoint A - Sample 3

Example of output by the end of completing checkpoint A

We will use additional sample inputs to test your program, and so should you.

The only way to get credit for Checkpoint A is to demo it for the course staff during any lab, drop-in tutoring or workshop before Thursday Sep. 15 at 7PM.


Checkpoint B (10 points)

For Checkpoint B, you will extend your code from Checkpoint A by doing the following::

NOTE: Your program's spelling, capitalization, and punctuation will need to match the sample output EXACTLY for this project.

NOTE: All floating-points need to be rounded to 3 decimal points. Let's say, you want to round-off a float called val then you may use round(val,3)

Here is sample input (in green) and output for Checkpoint B (ignore the last line in the sample output - that will be required for final code submission only). Again, these are just samples; we will test your code using additional inputs.

Checkpoint B - Sample 1

Example of output by the end of completing checkpoint B

Checkpoint B - Sample 2

Example of output by the end of completing checkpoint B

Checkpoint B - Sample 3

Example of output by the end of completing checkpoint B

The only way to get credit for Checkpoint B is to demo it for the course staff during any lab, drop-in tutoring or workshop before Monday Sep. 26 at 8PM.


Final Code

In your final code, you will extend your code to:

For example of this message, see the last line of the sample outputs in Checkpoint B above.

Make sure to test your code with all cases provided in the grading rubric here.

There is no demo for your final code. The deadline for submitting final code is Thursday, Sep. 29 at 11:55 PM. See the end of this specification for submission instructions.

Extra Credit (up to 10 points)

You can get extra credit for checking the user's inputs for errors. For example, you could reject zero or negative input for number of sports (+1), zero or negative input for number of participants (+2) and/or negative input for number of medals (+2). In each case, the program should display a user-friendly message.

You may also add another loop to compare overall scores of different countries and determine which one of them is the best. (+5)

Be sure you describe any extra-credit work in your docstring.


Grading

Correctness [55%]

The most important part of your grade is the correctness of your final program. Your program will be tested numerous times, using different inputs, to be sure that it meets the specification. You will not get full credit for this 50% unless your output matches the sample output exactly for every case, including capitalization and spacing. Attention to detail will pay off on this assignment. A detailed grading sheet for this project is posted here.

Programming Design and Style [25%]

In addition to being correct, your program should be easy to understand and well documented. For details, see the grading sheet above.

Checkpoints [20%]

Your checkpoints are each worth 10 points, as described above. The checkpoints cannot be submitted late.


Submitting your final code

You should submit your final code on Moodle by the deadline. As a backup, I strongly encourage you to upload a copy to your blue directory in case something goes wrong with your submission to Moodle.

Please name your file yourlastnameP1.py, substituting your actual last name (in lowercase) as indicated.

Collaboration policy

Programming projects must be your own work, and academic misconduct is taken very seriously. You may discuss ideas and approaches with other students and the course staff, but you should work out all details and write up all solutions on your own. The following actions will be penalized as academic dishonesty:

Late policy

There is a 48-hour grace period associated with the final project deadline. This grace period is designed to only cover small personal emergencies and other unexpected events. No other consideration will be given for these small emergencies.