CIS 636 Spring 2003                Assignment 2 – More Getting Warmed Up – a little OOP – using existing class       100 points

Assigned: 02/03/2003

Due: 02/10/2003 at the start of class 

 

You may work individually or in pairs for this assignment. But all work must be the work of the person/people whose name is on the code! If working in pairs, the individual contributions should be relatively equal. One possibility is to work together tonight, then finish separately (to avoid communication difficulties).

 

Main Assignment:

The International Olympic Committee needs a program to calculate ice skaters’ scores during competitions. The program (illustrated with an example below) first asks for the number of judges, then for the number of skaters. For each skater, it asks for their name, and country, and creates the skater. Then, for first artistry, then for technical merit, gets scores from each of the judges -  the program should ask for and ensure that it gets a valid score (between 0.1 and 6.0).. The skater’s artistry and technical scores are calculated by subtracting the highest score and the lowest score on the appropriate area from the total of all judges scores. The final total score is the sum of artistry and technical totals. The calculations can largely be done using capabilities of the Skater class.  I’ll try to do an example in class.

I have made available to you two I/O classes, RedmondMsgIn, and RedmondMsgOut, that take care of a lot of details of  I/O. I suggest that you use dialog boxes for input – provided in RedmondMsgIn class by readValidInt, readValidDouble, and readString, and for output – provided in RedmondMsgOut by display.  Using these will give you a little basic GUI style without many lines of code. 

  

Hand in:

 

Miscellaneous:

·         The Skater class is provided on the assignment page of my WWW site. You can get any of my IO code you need from the review page of my WWW site. 

·         You shouldn’t have to change anything in the Skater class (unless you are adding extra capability to your program). If you think you need to, ask me.

·         You shouldn’t have to change anything in RedmondMsgIn and RedmondMsgOut. The recommended methods make some simplifying assumptions, since we haven’t covered exception handling yet. This means that some exceptions will result if the user tries hard enough.  No biggie at this point.

·         Valid number of judges are from 6 to 10. Choices that are invalid shouldn’t cause problems with the program.

·         Valid number of skaters are from 3 to 100. Choices that are invalid shouldn’t cause problems with the program.

·         MAKE SURE YOUR PROGRAM WORKS! (i.e. more than just removing compile errors). Your program needs to be able to handle any valid inputs, and catch invalid values of the correct type (for now (until we cover exceptions), we won’t catch invalid values that are the wrong type (e.g. letters where numbers are needed)). 

·         Put YOUR NAME, and e-mail address in comments at the beginning of the program.

·         Remember: Indentation, meaningful variable names, and meaningful comments. Weaknesses in any of these could result in points off. You MUST include comments that explain your program in order to get full credit.