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

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
lastName: String
idNumber: int

Student(String, String, int)
Student()

setFirstName(String)
setLastName(String)
setIdNumber(int)

String getFirstName()
String getLastName()
int getIdNumber()

Submit

  1. Student.java
  2. 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
lastName: String
idNumber: int

Student(String, String, int)
Student()

setFirstName(String)
setLastName(String)
setIdNumber(int)

String getFirstName()
String getLastName()
int getIdNumber()

String toString()

Submit

  1. Student.java,
  2. 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
lastName: String
idNumber: int

Student(String, String, int)
Student(String, int)
Student(String)
Student(int)
Student()

setFirstName(String)
setLastName(String)
setFullName(String)
setIdNumber(int)

String getFirstName()
String getLastName()
String getFullName()
int getIdNumber()

Submit

  1. Student.java,
  2. your modified StudentTester.java
  3. 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

  1. Updated UML diagram
  2. Student.java
  3. your modified StudentTester.java
  4. one screenshot of a successful run
Copyright © 1999-2008| Gene Rohrbaugh | Privacy Statement