Question: Pleae help with this Problem 2: You are working at Ferrari and you are asked by your manager to design a class for the vehicles
Pleae help with this


Problem 2: You are working at Ferrari and you are asked by your manager to design a class for the vehicles Ferrari produces. A) Based on your experience, you decide to have the following design for the requested class: Class Name: Vehicle Fields: Chassis number (type int): This field is named: chassis_num Production cost (type double): This field is named: prod_cost Model name (type String): This field is name: model_name Production year (type int): This field is named: prod_year Constructors: Full-argument constructor No-argument constructor Copy constructor Getter and setter methods for each of the above fields. Override the toString() method to return the following String message: Ferrari Tributo with chassis number 12345 costs 1.5 Million SAR and is produced in year 2024. Note: This is a sample output for a Vehicle object with the following fields: chassis_num : 12345 prod_cost : 1.5 model_name : Tributo prod_year: 2024 Override the equals() method to compare two vehicles based on their chassis numbers. The method should return true if both vehicles have the same chassis number and false otherwise. B) Write a test or a driver class called: Test_ Vehicle. Create two objects of Vehicle class with the following details: Object 1 chassis_num : 12345 prod_cost : 1.5 model_name : Tributo prod_year: 2024 Object 2 chassis_num : 743823 prod_cost : 1.2 model_name : Lusso prod_year : 2023 Then, create a third object based on the second object using the copy constructor of Vehicle class. Print the content of the 3 objects. Update the production cost of the second object to 2.05. Compare the second and third objects. If both objects are identical, display the following message: We have two Ferrari cars with the same chassis number!! This must be wrong! In case, the objects are different, you should print the following message: We have no duplicate chassis number! Everything is cool! Important Notes: Submit the two Java files (Vehicle.java and Test_Vehicle.java) through LMS. Do NOT submit a zip or rar file. ONLY THE JAVA SOURCE FILES!!! Stick to the class names are specified in this document! DO NOT CHANGE THE CLASSES' NAMES OR METHODS' NAMES
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
