Build a console-based dealership inventory app across 5 cooperating classes — this is the Week 5 workshop
Build a command-line app for a used-car dealership. Load the dealership and its inventory from a pipe-delimited file, then offer a menu where the user can search vehicles by price, make/model, year, color, mileage, or type — or list all vehicles, add a new one, or remove one. Save back to the file after every change.
Five classes work together: a data class for a single Vehicle, a container class for the Dealership, a file-handling class, a UI class, and a tiny Program with main in it.
ArrayList<Vehicle>. All search/add/remove methods live here.getDealership() reads the file and returns a Dealership. saveDealership(d) writes it back.Dealership methods. Instantiates the Dealership itself (not Program).main() creates a UserInterface and calls display() — that's it.One pipe-delimited file. Line 1 is the dealership info; every line after is one vehicle.
Vehicle and Dealership with constructors and getters/setters only. Make every search method return null for now. Verify the project compiles before writing any logic.
DealershipFileManager.getDealership() — read the file, parse the first line into a Dealership, parse each remaining line into a Vehicle and add it. Leave saveDealership() empty for now.
UserInterface. display() calls init() which loads the dealership via DealershipFileManager. Show the menu loop. Implement processAllVehiclesRequest() first to verify the load worked.
Program.main(), instantiate UserInterface and call display(). Run it — you should see your inventory print.
saveDealership() after every add and every remove.
Workshop 4w — Car Dealership