Overview
Create and refine a Java Class Student to represent individual students. The first release will implement the basic framework, then each subsequent release will add or expand particular features.
All code should be commented, including
- a header comment, with Class name and description, @author and @version tags (updated for each release)
- javadoc style comments for each constructor or method, with @return and @param tags as appropriate
LEGEND: Keyboard Screen
Student (Release 1.0)
Implement the class Student according to the following UML diagram. The constructor that has no arguments should use default values "Jane" "Doe" "999999".
Test your code using StudentTester.java (release 1.0)
| Student |
|---|
firstName: String |
Student(String, String, int) setFirstName(String) String getFirstName() |
Submit
- Student.java
- one screenshot of a successful run
Student (Release 1.1)
Add a method toString() that returns a String representation of the Student object, in the following format (including the curly braces and comma):
{ Mary Jones, 999999 }
Test your code using StudentTester.java (release 1.1)
| Student |
|---|
firstName: String |
Student(String, String, int)
setFirstName(String) String getFirstName() String toString() |
Submit
- Student.java,
- one screenshot of a successful run.
Student (Release 1.2)
Add constructors and methods to allow the user to specify or retrieve the FULL NAME in addition to the first and last names separately. For example, if the user calls the constructor Student("John Doe"), it should construct a student with firstName=="John" and lastName=="Doe" (you can use String methods substring(int, int) and indexOf(String) to do the job of splitting).
Modify the earlier tester class so that it tests each of the new functionalities.
Specifically, you will implement three new constructors and two new methods as indicated in the UML diagram:
| Student |
|---|
firstName: String |
Student(String, String, int) setFirstName(String) String getFirstName() |
Submit
- Student.java,
- your modified StudentTester.java
- one screenshot of a successful run
Student (Release 1.3)
Modify your Student class to keep track of two additional fields: major (a String, e.g., "Biology," "Computer Science") and classification (an int representing year 1==first year, 2==sophomore, ...)
First, modify this UML diagram, highlighting the changes. Be as thorough as possible. What new data members must be stored? Are any new constructors needed? Any other new methods? Do any methods need to change?
Modify the tester class to test all the new functionalities.
Submit
- Updated UML diagram
- Student.java
- your modified StudentTester.java
- one screenshot of a successful run
