Introduction - If you have any usage issues, please Google them yourself
System Design
Class car:
includes car’s self-attributes, such as its number, logo, price.etc.
Class DataStream:
includes 2 methods, readData() and saveData()
readData(): use DataInputStream get data “CarData.txt”, and then put data into class car’s object.
saveData(): use Array store cars’ data their object, and use DataOutputStream to store data in “CarData.txt”
Class AddAndDel:
Includes 2 methods, addNewCar() and DelSoldCar()
addNewCar(): read Child object of car, add a new object in the end. Scan its details.
DelSoldCar(): scan the number of the sold car, mark it and scan its sale price and date of sale.
Class Show:
Includes 4 methods, showAll(), showOnList(), showOnListByDate() and showSold()
showAll(): Traversing all child objects and print them on screen.
showOnList():Traversing all child objects, recognize which have not been sold and print them on screen.
showOnListByDate(): On basis of showOnList(), using Bubbling algorithm to sort dates