Question: Write a program for a company called HFC Vehicle Solutions. the program will help the user to create a file with the configurations for multiple

Write a program for a company called HFC Vehicle Solutions. the program will help the user to create a file with the configurations for multiple vehicles. You must use methods, using the same names, where specified!
Your Java code must contain a class called Vehicle. The Vehicle class will contain the following data fields:
Vehicle:
` int doors
int wheels
int horsepower
int numPassengers
double price
String manufacturer
int crashRating
The class should contain all proper getters and setters. IT MAY OR MAY NOT NEED A CONSTRUCTOR. Please justify in the comments of your code the reason you either chose to create a constructor for this class or not. The crash rating must contain a value between 0 and 5. The price must be a number greater than 0. numPassengers must be a number greater than 0. The horsepower field must be a number greater than 100. The number of wheels must be a number greater than or equal to 2 and less than or equal to 8. The doors field must be a number greater than or equal to 0 and less than or equal to 8. Make sure that your code validates that the data is valid and if not it rejects the input and asks the user to retry.
There will be other classes that will inherit the vehicle class. They are the following:
Truck:
String modelName
double cargoCapacity
double towingCapacity
boolean bedliner
String type
SportUtilityVehicle:
String modelName
int numOfBenchSeats (values from 1 to 6)
double towingCapacity
Motorcycle:
String modelName
boolean sidecar
boolean signalLights
boolean radio
Car:
String modelName
boolean convertible
String engineType
Include all of the proper getters and setters for each field. Additionally, make sure that all values are valid. For all String variables, there are no specific values but you should only ever expect one word for each one. ALL CLASSES SHOULD BE IN THEIR OWN FILE. Do not forget to include a constructor for each one! Each of the child class should have their own method that will create a string for the values of the data fields that are contained within it.
PLEASE NOTE: The above are the only classes that are REQUIRED. However, you may find it advantageous to create another class or two in order to help you solve the problem.
The program will ask the user to create a list of cars that they wish to create. It will require a minimum of 2 vehicles to be created. The program will ask the user about the configuration of the vehicles that they wish to create. All values must be entered for the vehicle to be created. Once the user has completed the creation of the list of vehicles, the program will print the values out to the screen and if the user requests it, write everything to a file with the name VehicleCreationList.txt . HINT: In order to hold the values, it may be wise to create a list or array of the type Vehicle so that it can store all of the different types of vehicles the user can create!
Create Vehicle This method (createVehicle) should ask all of the questions required to create the vehicles. It should call createTruck, createSUV, createMotorcycle and createCar when required. It will allow the user to only create one of a particular vehicle type (Truck, SUV, Motorcycle or Car) but will allow the user to create as many of that type WITH THE SAME CONFIGURATION. In other words, they could create 10 Cars, but they would all be the same car. So data entry only occurs ONCE each time this method is called.
Create Truck This method (createTruck) will call another method (getGeneralInfo) that will obtain all of the information for the Vehicle class and then will obtain all of the extra information for the Truck class.
Create SUV This method (createSUV) will call another method (getGeneralInfo) that will obtain all of the information for the Vehicle class and then will obtain all of the extra information for the SportUtilityVehicle class.
Create Motorcycle This method (createMotorcycle) will call another method (getGeneralInfo) that will obtain all of the information for the Vehicle class and then will obtain all of the extra information for the Motorcycle class.
Create Car This method (createCar) will call another method (getGeneralInfo) that will obtain all of the information for the Vehicle class and then will obtain all of the extra information for the Car class.
Get General Info This method (getGeneralInfo) will obtain all of the information that can be stored in the vehicle class and will return a Vehicle to the calling function.
Print List This method (printList) will print out all the current vehicles the user has entered so far.
Create Vehicle List FiVehicle This method (createVehicle) should ask all of the questions required to create the vehicles. It should call createTruck, createSUV, createMotorcycle and createCar when required. It will allow the user to only create one of a particular vehicle type (Truck, SUV, Motorcycle or Car) but will allow theIf each class is not stored inside its own file there will be a 20% deduction from the final score of the exam.

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 Programming Questions!