Question: Write a program that will create and store Universities and Students as separate objects. The program will accept input data for the Student and University

Write a program that will create and store Universities and Students as separate objects. The program will accept
input data for the Student and University objects from two separate CSV text files. Then the program will output a
formatted report. An example output of the University report is included.
Name class
The Name class will contain the following information.
First Name // Fred
Middle Name // Lee
Last Name // Jones
The above fields will be immutable (use final in Java).
The Name class will implement the following methods at a minimum.
getFirstName():String
getMiddleName():String
getLastName():String
equals(Name):boolean true when the first, middle, and last name of the calling object are equal to the
first, middle, and last name of the argument object
toString():String returns full name with a space between each name
compareTo(Name):int returns -1 when the calling object should precede the argument object, 0 when the
first, middle, and last names are identical, 1 when the calling object should come after the argument object.
The order of precedence is last name, first name, middle name.
Person class
The Person class will use the Name class as an immutable (final) field variable and contain the following additional
information.
Age //19
Gender // M (This field will be immutable)
Street Address //1934 Same Street
City // Annandale
State // State
ZIP //02497
Phone number //7033345343
The Person class will implement getter and setter methods for each field variable, except the Name field which will
only require a getter. It will also include toString(), compareTo(Person), and equals() methods. The
equals(Person):boolean method will return true if calling Person object and argument Person objects Name, Age,
Gender and all address Fields are all equal. The compareTo(Person):int - returns -1 when the calling object should
precede the argument object, 0 when the calling object and argument objects are considered identical, 1 when the
calling object should come after the argument object. The order of precedence is Name; age, gender. For gender
female precedes male.
Student class
The Student class will extend the Person class and contain the following additional information.
Student ID // Combination of 10 numbers and uppercase letters (This field will be
immutable)
University name //
Credits enrolled //19
Qualifies for instate rate // yes or no
Late fee assessed // yes or no
Food Option Choice //A top plan, B middle plan, C bottom plan, D no plan
Health Option Choice // yes or no
NOVA Online CSC 222
2
The Student class will implement getter and setter methods for each field variable. It will also include toString(),
compareTo(), and equals() methods. The equals(Student):boolean method will return true if the Student objects and
the argument Student objects Name and student ID are equal. The compareTo(Student):int - returns -1 when the
calling object should precede the argument object, 0 when the calling object and argument objects are considered
identical, 1 when the calling object should come after the argument object. The order of precedence is Person, ID.
University class
Each university object will contain the following information.
University Name
Street Address //1934 Same Street
City // Annandale
State // State
ZIP //02497
Phone number //7033345343
In-State Tuition per credit
up to 12 credits
1218 credits
over 18 credits
Out of State Tuition per credit
up to 12 credits
1218 credits
over 18 credits
Late Fees
Incidental fees: per credit fee to some maximum fee
Optional Health Care: per credit scale
up to 12 credits
1218 credits
over 18 credits
On Campus Meal Plan
Two or more plans with different costs each
The University class will implement getter and setter methods for each field variable. It will also include toString()
and equals() methods.
Application program
The program will read from data files (StudentFile.txt and University9.txt) and store student and university objects
in two separate ArrayList objects. Be sure no duplicates in the two ArrayList objects. Then print reports for each
university to a text file.
Two input files are needed for the Students and the Universities.
The calculations for the report are as follows:
Note: Each university may have different rates, as specified in the universitys input record.
Tuition rates (per credit) Instate rate Out of state rate
Less than 12 credits $102.50 $351.00
1218 credits $75.45 $255.00
Credits over 18 $93.00 $304.00
Late fee is 10% of tuition bill figured on credit cost only.
Incidental fees are $20/ credit up to a maximum of $250.00.
Hint: to calculate the incidental fee, use Math.min(credits*incidentalFeeRate , incidentalFeeMax)
Optional health care: $25.00 first 11 credits
(per credit) $20.00 next 7 credits (from 12 to 18 credits)
$15.00 over 18 credits
If on campus food is the case, then further input from the user is necessary:
Meal plan A meals is $4,999.00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!