How would I structure this program? A bit unsure of what is being asked
You are required to write a software application that manages an international outdoor car rally for thirty-two (32) cars. Thirty-two countries around the globe have a single representative team to this tournament. For each race, four cars compete per race. The best 16 race times goes forward to the second round, and the best 8 to the third round and the best 4 to the finals. Each country has a team of two navigators and three drivers. One driver per team can drive no more than once, that is each team must have a new driver for each round, but navigators are the one who suffer if the team times are low. A team that progresses to the final round can chose any driver. Therefore a team may use only one navigator or may use both. The rule of thumb is that if the car placing in a particular race is last, then the navigator is not given the chance to race again.
Your solution may use the following ADTs but must show evidence of the bolded ones:
• A sorting algorithm of your choice to output the final list of participant sorted in order of tournament placing.
• A queue or stack structure to manage the race. Hint used predefined class!
• Linked list can be used. Their use in this solution set is intuitive.
You will need to use the Math object to generate a random number. In most races, times are lowered as you progress to the rounds. Therefore for the first race, your times may average 45-50 seconds, your second round times of 40-45 seconds, and your semifinal stage times of 39-42 second and the finals 37-40 seconds.
For examples your race time for second car in a Round One race may be assigned as follows
secondCar = 45 + Math.rnd() + RoundOneOffset ;
I looks to me like your instructor is asking you to create a race simulator. You'd probably need (at least) classes for drivers, navigators, cars, races (maybe), etc. You're using the math package to randomly generate course completion times for each car for each race.
Looks like you'd need to set up drivers and navigators for each car, run the race, then pick the winners for that race to go to the next round. Then repeat for each round until you get a final winner.
My first suggestion though would be to talk to the instructor (or aides) if you don't understand the assignment. Anything you get here is just guesswork as we are not the instructor.
By Ervin Rodriguez in forum Database
Last Post: 05-16-2003, 08:45 AM
By mheasen in forum Architecture and Design
Last Post: 03-20-2002, 09:24 AM
Last Post: 03-07-2002, 07:49 AM
By Matty in forum Open Source
Last Post: 12-16-2001, 11:17 AM
Last Post: 12-15-2000, 10:07 PM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center