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
equalsName: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
compareToName:int returns when the calling object should precede the argument object, when the
first, middle, and last names are identical, 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
Gender M This field will be immutable
Street Address Same Street
City Annandale
State State
ZIP
Phone number
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 compareToPerson and equals methods. The
equalsPerson:boolean method will return true if calling Person object and argument Person objects Name, Age,
Gender and all address Fields are all equal. The compareToPerson:int returns when the calling object should
precede the argument object, when the calling object and argument objects are considered identical, 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 numbers and uppercase letters This field will be
immutable
University name
Credits enrolled
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
The Student class will implement getter and setter methods for each field variable. It will also include toString
compareTo and equals methods. The equalsStudent:boolean method will return true if the Student objects and
the argument Student objects Name and student ID are equal. The compareToStudent:int returns when the
calling object should precede the argument object, when the calling object and argument objects are considered
identical, 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 Same Street
City Annandale
State State
ZIP
Phone number
InState Tuition per credit
up to credits
credits
over credits
Out of State Tuition per credit
up to credits
credits
over credits
Late Fees
Incidental fees: per credit fee to some maximum fee
Optional Health Care: per credit scale
up to credits
credits
over 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 StudentFiletxt and Universitytxt 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 credits $ $
credits $ $
Credits over $ $
Late fee is of tuition bill figured on credit cost only.
Incidental fees are $ credit up to a maximum of $
Hint: to calculate the incidental fee, use Math.mincreditsincidentalFeeRate incidentalFeeMax
Optional health care: $ first credits
per credit $ next credits from to credits
$ over credits
If on campus food is the case, then further input from the user is necessary:
Meal plan A meals is $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
