Question: IN JAVA : 1. Define a PersonType object that represents a person's name, gender, social security number, race, and address. Be sure to define the

IN JAVA :

1. Define a PersonType object that represents a person's name, gender, social security number, race, and address. Be sure to define the relevant methods to fully implement the PersonType object. Define a StudentType object to inherit attributes of the PersonType object. However, each student has a student ID number, classification (graduate or undergraduate),  major, gpa, and course list. A student should be able to change their major, enroll and unenroll from a course, and keep track of their how many semesters they have enrolled. 

Syntax: modifier class ClassName extends ClassName { } PersonType

 

ssn : long
address : String
gender : char
race : String
name : String
PersonType() : --
PersonType(name, ssn) : --
PersonType(PersonType p) : -- //copy constructor


setName(name) : void
setNameAndSSN(name, ssn) : void
setAll(name, ssn, gender, race, address) : void

getName() : String
getSSN() : long
getGender() : char
getRace() : String
getAddress() : String

 

print() : void
2. Write the definition of the main in the Driver class to test the functionality of each of the implemented objects from number 1
1. Declare two StudentType object, student1 and student2.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the Java code for the PersonType and StudentType classes as well as the main method in the Driver class to test the functionality java PersonTyp... View full answer

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 Algorithms Questions!