it is required to write the class in java:(thanks for helping)
Posted: Fri May 20, 2022 12:43 pm
it is required to write the class in java:(thanks for
helping)
1. Write the class Vehicle to represent a motor vehicle. Your code should include: a) Declarations of 3 attributes: vehicle number, model, price. b) A constructor that gets (as parameters) a vehicle's number, a model and price. c) An accessor method named getVehicle Model that returns the vehicle's model. d) A method named computePrice that returns the price of the vehicle. e) AtoString method which returns a string formatted as in the following example: Vehicle #: A1001 Vehicle Model: Toyota - Camry Price: $25000.50
helping)
1. Write the class Vehicle to represent a motor vehicle. Your code should include: a) Declarations of 3 attributes: vehicle number, model, price. b) A constructor that gets (as parameters) a vehicle's number, a model and price. c) An accessor method named getVehicle Model that returns the vehicle's model. d) A method named computePrice that returns the price of the vehicle. e) AtoString method which returns a string formatted as in the following example: Vehicle #: A1001 Vehicle Model: Toyota - Camry Price: $25000.50