Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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, addy) : 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 Exercise 1. Declare two StudentType object, student1 and student2.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

1. Define and explain culture and its impact on your communication

Answered: 1 week ago