Programming Assignment #5 Due: Tuesday, Apr. 11, 11:00 p.m.
turnin code: srwJ.p5
Accepted until: Wednesday, Apr. 12, 11:00 p.m.
turnin code: srwJ.p5.late
Note: This an extension of program 4.
---------------repeated information below-----------------------
A Runner object has instance variables:
runnerId (4 digits -- unique identifier)
first name (String)
last name (String)
age (in years)
sex (F or M)
an array of 8 5K times (float)
and methods:
constructor
getAverage(): float (average times of all runs completed)
getFastestTime(): float (fastest 5K completed)
getFastestEvent(): int (raceID of fastest 5K completed)
toString(): String
any others you want
A RaceEvent object has instance variables:
raceId (int 1000 - 1007)
date (String -- mm/dd/yyyy)
temp (low, med, high)
terrain (flat, hilly, beach)
and methods:
constructor
toString(): String
any others you want
A Contest object has instance variables:
Winner : Runner
and methods:
getHeadCount(Runner[], RaceEvent): int (number of runners participating)
getWinner(Runner[], RaceEvent, int place): Runner in place "place" in that
race.
------------------------repeated information above----------------------
-----------------------new information below---------------------------
There are three data files. Their names are arguments to main (see program
URLDissector on page 240 in text and use args[0], args[1] and args[2] in place
of literal filenames).
-----------------------new information above---------------------------
------------------------repeated information below----------------------
The first input file is data about runners. There are at most 20 runners.
Each data set includes:
runner id
first name
last name
age
sex
8 5K times (float)
The data items are speparated with by space.
The 8 float values represent the runner's time in each of the 8 races 1000
through 1007. If a runner did not participate in a race, then his/her time
for that event is 0. No data item has embedded white space.
The second input file is data about the 8 races. Each data set includes:
id
date
temp
terrain
The data items have values as described above and are separated by white space.
No data item has embedded white space.
------------------------repeated information above----------------------
------------------------new information below----------------------
The third input file provides paramaters for a category of event and
consists of two strings:
temperature (low, med, high)
terrain (flat, hilly, beach)
Your program reads the runner data into an array of runner objects and the
race data into an array of race objects and processes each data set in the
third input file as follows: for each temperature/terrain pair, find the
name of the runner with the fastest time and the race id for that temperature
and terrain.
------------------------new information above----------------------
------------------------repeated information below----------------------
Output: Your name, UNF id, and "program 1" (Your name, UNF id and pgm# is
required output at the beginning of each program output)
A list of runners (id, first name, last name, age, sex, fastest 5K with
raceID, average 5K time
A list of race events (id, date, temp, terrain, #of participants, runner id,
name, age and time of winning male and winning female)
------------------------repeated information above----------------------
------------------------new information below----------------------
Output (continued):
For each data set in the third input file, the temp and terrain along with
the name of the runner, his/her time, age and sex, and the race id for the
fastest time in any race event with the given conditions.
Specs: Name your file containing main 5Ks.java
The output should appear in a good, readable format using white space
and/or blank lines for readability.
Your program should use (minimally) the classes given.
Your program should be in a good, readable style like the sample
programs in the text.
When you are ready to turn in your program, copy readme5 out of the class
public directory on osprey and fill it out and then use the shar utility
to put the readme5 file and your .java files (NOT the .class files) into
1 file to turnin. (If you don't have notes from the class discussion of
shar, see the "How to ..." section of our class web page. When you have
created your shar file, turn it in using the turnin code srwJ.p5: "turnin
srwJ.p5"
If you wish to verify that your program was turned in correctly:
check the size of your sharfile
"ls -l
Note the size in bytes
check the size of the turned in file:
"turnin -c srwJ.p5"
Make sure the size of the original file and the turned in file are the same.
Evaluation: max 50 pts. Note: if you did not have the list of runners and the
list of events output correctly as specified for pgm4 and that has been fixed
in pgm5, you can receive up to 40 additional points (total not to exceed
150 total for both programs).
Late: max 40 pts.
Evaluation based on object oriented design, correct and well formatted output
as specified and well formatted and readable program with appropriate comments.