Description: 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
To Search:
File list (Check if you may need any files):
UsedCarSystem\CarData.txt
UsedCarSystem
.............\bin
.............\...\CSE105
.............\...\......\AddAndDel.class
.............\...\......\Car.class
.............\...\......\DataStream.class
.............\...\......\Menu.class
.............\...\......\Show.class
.............\build.xml
.............\manifest.mf
.............\nbproject
.............\.........\build-impl.xml
.............\.........\configs
.............\.........\.......\DataStream.properties
.............\.........\.......\Menu.properties
.............\.........\.......\test.properties
.............\.........\genfiles.properties
.............\.........\project.properties
.............\.........\project.xml
.............\src
.............\...\CSE105
.............\...\......\AddAndDel.java
.............\...\......\Car.java
.............\...\......\DataStream.java
.............\...\......\Menu.java
.............\...\......\Show.java
.............\System Design.docx