- Implement The Following Classes Assume Having A Club That Provides Two Racing Games Car Racing And Horse Racing Racin 1 (58.85 KiB) Viewed 32 times
Implement the following classes. Assume having a club that provides two racing games: car racing and horse racing. Racin
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Implement the following classes. Assume having a club that provides two racing games: car racing and horse racing. Racin
Implement the following classes. Assume having a club that provides two racing games: car racing and horse racing. RacingGame teaml:String team2:String +RacingGame(t1:String, 12: String) + toString(): String + getter/setters() 4 type1: String Horses: Hourse [] Horse name: String age: int . - yearl String . type2: String . year2 String + HorseRace(All parameters) +getHorsel(): Horse + getHorse2(): Horse +toString(): String + Horse (All parameters) + getName(): String + getAge(): int + CaRace(All parameters) + toString(): String + getters/setters() A. RacingGame class is characterized by two String attributes team/ and team2. This class has as methods: A constructor that initializes the attributes. [5 pts] ● • A toString method that returns the information in the form TeamNamel vs TeamName2. [5 pts] getter/setter methods. [5 pts] B. The CarRace class that inherits from RacingGame. It has four String attributes the type (e.g. Honda) and the year (e.g. 1998) of the first team and those of the second team. This class has as methods: ● A constructor that initializes all attributes. [5 pts] . A toString method that returns the information in the following form. [5 pts] TeamNamel vs TeamName2 Honda 1998 vs BMW 1997 ● getter/setter methods. [5 pts] CarRace HorseRace