Question: Part 1 You will create two classes Car and RaceLane. Your main method will go in RaceLane1. 1. Define a class Car. All of the

 Part 1 You will create two classes Car and RaceLane. Yourmain method will go in RaceLane1. 1. Define a class Car. Allof the below properties/methods should be non static. ACar should have fiveprivate properties: a String for the model of the car (e.g. ToyotaCamry), an int location, an int currentSpeed, a boolean movingForward, and anint maxSpeed. The idea is that the location data member stores where

Part 1 You will create two classes Car and RaceLane. Your main method will go in RaceLane1. 1. Define a class Car. All of the below properties/methods should be non static. ACar should have five private properties: a String for the model of the car (e.g. Toyota Camry), an int location, an int currentSpeed, a boolean movingForward, and an int maxSpeed. The idea is that the location data member stores where on a number line the Car is. Make sure the number entered is 2 0 a. b. A default constructor. A constructor that takes as input three things: A String for the model, an int maxSpeed, and an int for an initial location. It should set the model of the Car, the max speed, and initial location appropriately based on the input. The constructor should make it so that the movingForward property should always be initially set to be true. The currentSpeed should always be initially set to be 0. c. d. Write three methods called getModel(), getDirection(), and getLocation() that let you retrieve the model, movingForward, and location properties respectively

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!