Question
Please solve this java programming question, I put much details to make clear : Here is Main.java file : /** * Main class to test
Please solve this java programming question, I put much details to make clear :
Here is Main.java file :
/**
* Main class to test hw0 classes
* Other classes include: Race and Racer that students should implement
*
* CS 305, Fall 2018
* @author Martin Cenek, Tammy VanDeGrift
* @version January 2018
*/
public class Main {
public static void main(String[] args) {
// create Race objects
Race tdf = new Race(-3); //should create a tour de france (tdf) Race with default of size 20 racers
Race vuelta = new Race(2);
// create items
Racer mickey = new Racer(101, "Mickey Mouse", 18);
Racer pluto = new Racer(333, "Pluto Disney", 16);
Racer goofy = new Racer(222, "Goofy Diskey", 21);
Racer daisy = new Racer(912, "Daisy Duke", 28);
Racer mary = new Racer(124, "Mary Poppins", 41);
Racer pink = new Racer(545, "Pinkalicious", 16);
Racer huey = new Racer(322, "Huey Duck", 15);
Racer dewey = new Racer(122, "Dewey Duck", 15);
Racer louie = new Racer(111, "Louie Duck", 15);
Racer peanut = new Racer(121, "Peanut Brown", 17);
Racer froom = new Racer(1, "Chris Froom", 38);
Racer contador = new Racer(201, "Alberto Contador", 40);
// put some items into Race (scanned for checkout)
tdf.addRacer(mickey);
tdf.addRacer(pluto);
tdf.addRacer(goofy);
tdf.addRacer(daisy);
// for write-up: draw a picture of what tdf's racer roster looks like
// print Race
tdf.printRace();
// put more items into Race
tdf.addRacer(mary);
tdf.addRacer(pink);
tdf.addRacer(huey);
tdf.addRacer(dewey);
// print Race
tdf.printRace();
// add items
tdf.addRacer(louie);
tdf.addRacer(peanut);
// print Race
tdf.printRace();
// add riders to vuelta
vuelta.addRacer(pluto);
vuelta.addRacer(pink);
vuelta.printRace();
// add another item
vuelta.addRacer(huey);
// for write-up
//System.out.println(vuelta);
//System.out.println(tdf);
return;
}
}
Specification For this project, implement a record keeping application for bicycle racing. The implementation should include 3 Java classes: o Main (provided to you) o Race (you should implement this class) o Racer (you should implement this class) Here are the class diagrams for the two classes you should implement: ace Racer Race : Racerl] numRacers : int maxRaceSize : int bibNumber: int -name: String age: int +Race(maxRaceSize: int) addRacer(racer : Racer): int printRace) : void +Racer(bibNumber: int, name : String, age: int) printO:void getAge0 int Recall that - means private and + means public. Thus, the instance variables in the classes should be private and the constructors and methods should be public
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started