Page 1 of 1

Create two classes: Vehicle and Unmannedvehicle. The class Unmannedvehicle is a subclass that extends the class Vehicle.

Posted: Sun May 15, 2022 2:00 pm
by answerhappygod
Create Two Classes Vehicle And Unmannedvehicle The Class Unmannedvehicle Is A Subclass That Extends The Class Vehicle 1
Create Two Classes Vehicle And Unmannedvehicle The Class Unmannedvehicle Is A Subclass That Extends The Class Vehicle 1 (71.55 KiB) Viewed 62 times
Create Two Classes Vehicle And Unmannedvehicle The Class Unmannedvehicle Is A Subclass That Extends The Class Vehicle 2
Create Two Classes Vehicle And Unmannedvehicle The Class Unmannedvehicle Is A Subclass That Extends The Class Vehicle 2 (82.56 KiB) Viewed 62 times
Create Two Classes Vehicle And Unmannedvehicle The Class Unmannedvehicle Is A Subclass That Extends The Class Vehicle 3
Create Two Classes Vehicle And Unmannedvehicle The Class Unmannedvehicle Is A Subclass That Extends The Class Vehicle 3 (14.08 KiB) Viewed 62 times
Create two classes: Vehicle and Unmannedvehicle. The class Unmannedvehicle is a subclass that extends the class Vehicle. You are also required to write the driver class Vehicle Information, which allows you to test your implementation of vehicle and Unmannedvehicle. The following are implementation details for the classes you need to implement (provided when not self-evident): . o 1 Vehicle class Private fields String vehicleName String vehicle Manufacturer int yearBuilt int cost Public class constant field int MINYEARBUILT equals to 1886 (as modern cars were invented in 1886) getter and setter methods depending on your program design void printinfo() method: Print out the rmation of Vehicle, including its name, manufacturer, year built, and cost. An example of the output of this method is as follows: Vehicle Information: Name: RAV4 Manufacturer: Toyota Year built: 2021 Cost: 38000 Note: As shown in the above example output, starting from the second line, each line has three spaces at the beginning. . o 1 Unmannedvehicle class Extends the vehicle class. o Additional private fields: int SAE and int rating SAE (level of automation) is between 0 and 5 and the rating between 0 and 10. Public class constant fields for min and max SAE and, min and max rating o getter and setter methods depending on your program design Overrides the void printinfo() method of the superclass. The method not only print out the information of name, manufacturer, year built, and cost, but also print out the information about SAE and rating. An example of the output this method is as follows. ооо Vehicle Information: Name: Model Z

Manufacturer: Tesla Year built: 2022 Cost: 88000 SAE: 3 Rating: 7 Your VehicleInformation.java would use Vehicle and UnmannedVehicle classes. To do that, it has two methods Vehicle buildVehicle() and Unmanned Vehicle buildUnmanned Vehicle() that validates the information before calling the Vehicle/Unmanned Vehicle constructor. Information to validate are built Year, cost, SAE and rating. These methods will return the object reference if successful, null otherwise. Your main method should demonstrate the (tentative) creation of 2 unmanned and 2 regular vehicles. Below is the sample output. Sample Output Error: invalid yearBuilt. Object not created! Vehicle Information: Name: RAV4 Manufacturer: Toyota Year built: 2021 Cost: 38000 Error: invalid sae. Object not created! Vehicle Information: Name: Model s Manufacturer: Tesla Year built: 2022 Cost: 80000 SAE: 2 Rating: 3 Another Sample Output Vehicle Information: Name: ZS Manufacturer: MG Year built: 2018 Cost: 35000 Vehicle Information: Name: RAV4

Manufacturer: Toyota Year built: 2021 Cost: 38000 Vehicle Information: Name: AutoLab Manufacturer: RMIT Year built: 2002 Cost: 198000 SAE: 5 Rating: 9 Vehicle Information: Name: R1T Manufacturer: Rivian Year built: 2022 Cost: 90000 SAE: 4 Rating: 8