Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The app must have at least four classes using the MVC model. The application class where main() is located is considered a class. ModelCar
The app must have at least four classes using the MVC model. The application class where main() is located is considered a class. ModelCar class should contain the data about the Car. ModelCar class should have the following fields: 1. year - int that holds the car's year. 2. make-string that holds the car's make 3. speed - int that holds the car's current speed ModelCar class should have the following Constructor: A constructor that accepts the car's year, make, and speed. In the body of the constructor move the parameter values into the fields. ModelCar class should have the following methods: getter and setter methods for each field. get ds - should get the values store in the objects field. set methods - should be capable of moving a passed value into the field. accelerate method - should add 5 to the speed field each time it is called brake method - should subtract 5 from the speed field each time it is called. View class should handle all interaction with the user 1. prompt the user to enter car's make 2. prompt the user to enter car's model 3. prompt the user to enter speed 4. Include a method to display the information about a car to the user. Sample Output: Car Year: Car Model: Current Speed: Speed after accelerating: Speed after accelerating: Speed after accelerating: Speed after braking: Speed after braking: Speed after braking: 2015 Mustang 50 8888888 55 60 65 60 55 50 1. Controller class should control the communication between model and view and the program flow of the app. 1. create a method named missionControl that controls the program flow. 2. create an instance of the ModelCar class and pass the values retrieved from the user. 3. call the accelerate method 3 times. 4. call the brake method 3 times e. Admin Class - should provide introductions, directions and closing of the app. f. Main Class - should contain the main method. Within main() the app should create an instance of the Controller class and call the mission Control() method of the controller class.
Step by Step Solution
★★★★★
3.50 Rating (150 Votes )
There are 3 Steps involved in it
Step: 1
It looks like youre working on a Java application using the MVC ModelViewController model Heres a ba...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