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:
For Checkpoint A, you will need to demonstrate a program that does the following:
weighted score (WS) = 0.6*G + 0.3*S + 0.1*B
where G, S and B are the number of gold, silver and bronze medals, respectively.
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.
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.
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.
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.
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.
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.
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.
In addition to being correct, your program should be easy to understand and well documented. For details, see the grading sheet above.
Your checkpoints are each worth 10 points, as described above. The checkpoints cannot be submitted late.
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.
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:
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.