
Design a class Car having parameterized constructor that takes two arguments as an input i.e noOfGear and color and a printCarInfo method that prints the CarInfo i.e noOfGear and color.
Design another class RaceCar having parameterized constructor has an additional attribute maxSpeed and printRaceCarInfo method that prints the RaceCarInfo i.e noOfGear, color and maxSpeed.
Note: You have to create an object of class RaceCar and call the printRaceCarInfo method.
Input Format:
The first line of input contains a single integer representing noOfGear.
The second line of input contains a string without any preceding and trailing spaces, denoting the color of the car.
The third line of input contains a single Integer representing maxSpeed.
Output Format:
The first line of output prints the number of gears in the car
The second line of output prints the color of the car.
The third line of output prints the maximum speed of the car.
5
red
1000
noOfGear: 5
color: red
maxSpeed: 1000
When we call the printInfo function, all the info related to the car will be printed the same as the above format.