enter image description here
Can you give me the code?
- Create a class called car.
Each car has:
a cusromer name rowner name
a type (BMW, Mazda, or Toyota) a colour White. Red. or Silver)
a status used. new
an amount a price
tax (a percentage -> between 0 and 1)
Note that:
Type and colour can be defined as static integers
Status can be defined as Boolean
The class has
one constructor that takes values for all these data rields.
b. A getPrice() method that returns the price of the car that returns the price of the car
after the tax (car price = amount + (amount* tax))
An overridden toString0 method
All required setters and getters.
[ Practical Final
Customer Name
Car Tune
status
BMW
White
O used
O new
Add
Clear
Print List
Write to File - Create a class that creates the GUI for this project, as shown in the picture.
The buttons on this GUE
a. Add: creates a new Car object with the data that is taken from the text fields, combo boxes and radio buttons, and adds it to an array list.
Clear: clears all the data written in the text fields.
c. Print List: prints the data about each car in the array list using the toString method in the Car class to the text area in the GUI
New contributor
22120241 Tasnim Mahmoud Ahmad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.