The goal of this assignment is to demonstrate your knowledge of Java classes. You will do this by writing three Java classes, that will contain constructors, accessor methods, and mutator methods. You will also write another Java class that has a main method that will test your classes.

You will write a Java class, Student, that represents a student at the university. The Student should have the following private attributes:

  • int student ID number
  • String first name
  • String last name
  • Address - an object representing the mailing address of the student
  • List transcript - a List of grade objects

You will define the class Address that represents the mailing address of the student. The Address should have the following private attributes:

  • int address number
  • String street name
  • String city
  • String state
  • String zip code (cannot be an int, because some zip codes can start with a 0)

You will define the class Grade that represents a single entry on a transcript. The Grade should have the following private attributes:

  • String courseName
  • double gradePoints - (A: 4.0, A-: 3.7, B+: 3.3, B: 3.0, B-: 2.7, etc.)
  • int numOfUnits

For ALL Classes

You will write the appropriate accessor and mutator methods for all attributes in all classes as well as default and copy constructors. You may wish to add other constructors for convenience of testing, but see the test file for what constructors are required. All classes will also need to override the .toString() method which will list the information of the class in the same format as the sample below:

First Name: Joe
Last Name: Bruin
Student ID: 12345678
Address: 1234 Campus Dr.
Los Angeles, CA 90095
ICS 31: 3.7 - 4
ICS 6B: 4.0 - 4
ICS 32: 3.0 - 4
Units: 12
GPA: 3.5666666667

Formatting Notes: It is important to have the same spacing, and capitalization as the sample, or your code will not pass automation). There is a space after every ":", and a space before and after the "-".

You will also write the following three methods in the class Student:

A method that will allow grades to be inserted/added. The method header will look like:

@param String description is the course title or description
@param double gradePoints is the point value of their grade (A: 4.0, A-: 3.7, B+: 3.3, B: 3.0, B-: 2.7, etc.)
@param int units is the number of units the course was worth
public void addGrade( String description, double gradePoints, int units )

A method that calculates how many units the student has. The method header will look like:

public int getUnits()

A method that calculates the GPA of the student. The method header will look like:

public double getGPA()

Testing

Please be sure to test your java files using JUnit, and my test file. This will ensure that your class and methods are named correctly, and that the methods have some level of functionality. If your code passes my test file, this simply ensures you will have no compiler errors when your file is run through automation, and does not guarantee full credit for this assignment. You need to perform your own rigorous testing to ensure your logic is accurate for all allowable scenarios.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.