Question: JAVA CODING: public class Main { public static void main(String[] args) { final int roadServiceMonth = 6; MiniCooperS mini = new MiniCooperS(roadServiceMonth); mini.steer(45); mini.steer(10); mini.steer(-5);

JAVA CODING:

JAVA CODING: public class Main { public static void main(String[] args) {

final int roadServiceMonth = 6; MiniCooperS mini = new MiniCooperS(roadServiceMonth); mini.steer(45); mini.steer(10);

public class Main {

public static void main(String[] args) {

final int roadServiceMonth = 6;

MiniCooperS mini = new MiniCooperS(roadServiceMonth);

mini.steer(45);

mini.steer(10);

mini.steer(-5);

mini.accelerate(30);

mini.accelerate(20);

mini.steer(20);

mini.accelerate(-45);

mini.accelerate(5);

mini.steer(0);

mini.accelerate(-10);

System.out.println(mini.toString());

}

}

mini.steer(-5); mini.accelerate(30); mini.accelerate(20); mini.steer(20); mini.accelerate(-45); mini.accelerate(5); mini.steer(0); mini.accelerate(-10); System.out.println(mini.toString()); } } Q1:

Q1: (50 marks): Building a Car with automatic gear shifting You are building a car that will shift gear (automatically) base on the velocity changed according the following table high 10 20 30 40 > 41 Gears 1 2 low 0 21 31 41 4 5 For this problem, there are three main components (vehicle, Car, and your specific car) You can start with a base class Vehicle, and then create a Car class that inherits from this base class (Vehicle). From the Car class you can create a specific car (that you like) and inherits from the Car class. I like my MiniCooperS convertible and I use that for my example. From my mini, I want to be able steer (turn in 0 to 80 degrees) to change directions, and change velocity

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!