It is just a backup of my Java homework. Thanks to my Java teacher Jie LI. 😄
Simple.
Defined two exception classes named ScoreException, StudentNumberException based on the homework 1. Throw exceptions when the input is invalid.
Use inheritance to define the following 5 classes:
Based on the homework 3, defined a class named factory and save all the employees into its HashMap.
Designed a graphic user interface to input the employee and calculate their average salary information based on the homework 3.
Designed an online shopping system(actually it's not online). The relations of the classes in the system is shown below.
Use Singleton Pattern, Factory Pattern, Strategy Pattern, Composite Pattern, Observer Pattern to build a online shopping system, and use Swing to design a graphic user interface for it.
In the end, this is my class diagram which is generated by Eclipse Java Oxygen:
And these is the screenshot of my online shopping system, which is recorded by ScreenToGif:
It's really fun!
Note that you may fail to compile due to encoding. If you encouter encoding problems, please add the parameter -encoding UTF-8.
javac StudentTest.java
java StudentTest
javac StudentListTest.java
java StudentListTest
javac StudentTest.java
java StudentTest
javac Main.java
java Main
javac MainWindow.java
java MainWindow
javac Sale.java
java Sale
It's a simple version of Homework 7. It just output the total price.
javac MainUI.java
java MainUI
All the 7 problems are in the docs folder.