Take-Home Exam:OOP with Java
Total Mark: 100 +40 (optional) =140
Due: 12 pm 10/25/2003
Problem and Analysis: Write a simple Java Program to implement student mark management system with Swing.
Question 1: The student.txt file(in last page)is a pure text file. There are five students info there. Open and read the file and understand the structure. (5%)
Question 2: Write a Person interface with setFirstName(String) , getFirstName(), setLastName(String),getLastName() methods. Put person class in person package.(5%)

Question 3: Write a Student class which implements Person. You need to offer set and get methods for major, OOP_java_Mark, Web _Page_Mark and E-commerce_Mark. Student is a some package with person (5%).
The student conrtructor likes this:

Student(String fristName,String lastName,String major,double oop_java_mark, double web_page_mark,double e-commerce_mark)

Question 4: Write a class: DataLoad.java. You need offer the following methods:(15)
You can create a HashMap object to hold your student: HashMap studentTable=new HashMap();

/*-----------read txt file from disk-------------*/
public void readStudentFile(String fileName)throws IOException{ }
/*----------retrieve student from your studentTable-----*/
public Student getStudent(String firstName,String lastName){ }
/*----------get course average --------------------------*/
/*---You input the course name, you can get average of this course---*/
public double getAverage(String courseName){ }
/*----get student average----------*/
/*----for example: If your java: 90, web_page:89, e-commerce: 91, your average is:(90+89+91)/3--*/
public double getStudentAverage(String firstName, String lastName){ }
/*------retrieve all students--------*/
public HashMap getAllStudent(){ }
/*------retrieve specific student------*/
public Student getStudent(String firstName,String lastName){ }
/*-----put student into student table-----*/
public void putStudent(Student student){ }

Note: To implement the above methods, maybe you need other methods.

Question 5: Write a GUI interface like this.(10)

 

Question 6. Implement the add button function: When add button is pressed, the second window should
appear to get the new student information.(30%)

When Save button is pressed, the information is checked.

When every information is ok, you can add a studnet into student table(hashMap)

 

Question 7(Optional): When remove button is pressed, you can remove student.(20)
Question 8: When statistic button is pressed in the mian window, The statistic info is display.(Take OOP-java as a example).(25)
Question 9(optional) Add a button called Save between Edit Marks and Exit. This button will save all your change to student.txt file(20).
Question 10: When "Exit" button is pressed, stop this program.(5)

file: student.txt

FirstName/LastName/major/OOP-Java/Web Tech/E-commerce Tech.
Chang/Lee/Inernet System Developer/90/92/80
Eric/Guinko/Inernet System Developer/58.0/98.0/99
Dave/Avon/Inernet System Developer/78.0/90.0/68
Fung/Peter/Inernet System Developer/20.0/80.0/90
Thomas/Kelvin/Inernet System Developer/90.0/89.5/99