PUSAT PENGAJIAN SAINS KOMPUTER
UNIVERSITI SAINS MALAYSIA
Semester 1 Session 2010/2010
CPT111 – Principles of Programming
Assignment Part IV (ARRAYS & FUNCTIONS) DUE 24/10/2010
For each question below, you are to include the following details: i) Specification Requirements ii) Problem analysis –include input , process, output and test data. iii) Design (pseudo code) iv) C++ code ( source code) v) Print screen of output.
In the XIX Commonwealth Games, the Medals Tally shows the list of participating countries according to their achievements of gold, silver, and bronze medals. The arrangement is based on the highest number of medals and if they are the same, the country will be displayed in alphabetically order.
Assume there are 10 countries and 10 games; each game will be given only 1 gold medal, 1 silver medal and 1 bronze medal.
Your program will display the Medals Tally based on the results of the 10 games.
The results of each 10 games will be randomly generated.
Sample Outputs:
Gold Silver Bronze Total
AUS 0 0 0 0
CMR 0 0 0 0
ENG 0 0 0 0
IND 0 0 0 0
JAM 0 0 0 0
KEN 0 0 0 0
MAS 0 0 0 0
NGR 0 0 0 0
SIN 0 0 0 0
WAL 0 0 0 0
Gold Silver Bronze
Game 1 AUS IND ENG
Game 2 ENG AUS MAS
Game 3 ...
...
Gold Silver Bronze Total
AUS 1 1 0 2
ENG 1 0 1 1
IND 0 1 0 1
MAS 0 0 1 1
CMR 0 0 0 0
JAM 0 0 0 0
KEN 0 0 0 0
NGR 0 0 0 0
SIN 0 0 0 0
WAL 0 0 0 0
INSTRUCTIONS:
Please submit your typewritten report by Sunday 24/10/2010 by 11:59 p.m by uploading the softcopy to moodle and drop the hardcopy into post box level 6. Save all the programs and report in one folder and zip the folder before you upload. Please make a cover page with the following information
Course:
Name:
Matric No:
Group/Subgroup:
The name of the folder that you upload must follow this standard: PROG IV YOUR FULL