The Person constructor has two String parameters, a first name and a last name. The constructor initializes the e-mail address to the first letter of the first name followed by the first five letters of the last name followed by @jc.com. e-mail address will be the first letter of the first name followed by the If the last name has fewer than five letters, the entire last name followed by @ic.com Examples:

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter1: A First Program Using C#
Section: Chapter Questions
Problem 7RQ: The technique of packaging an objects attributes into a cohesive unit that can be used as an...
icon
Related questions
Question
100%

Consider the following detailed inheritance hierarchy diagram:

(ATTACHED IN IMAGE)

 

The person constructor has two string parameters, a first name, and the last name. The constructor initializes the e-mail address to the first letter of the first name followed by the first five letters of the last name followed by @jc.com. If the last name has fewer than five letters, the e-mail address will be the first letter of the first name followed by the entire late name followed by @jc.com

Override Object's toString method for the Person class. The toString method should return the present state of the object. Assume that the constructor writer for the previous part of this problem works as intended. 

Inheritance and Polymorphism
Free Response Questions:
Consider the following detailed inheritance hierarchy diagram
Person
instance variables
private String myFirstName
private String myLastName
private String myEmailAddress
methods
public String getFirstName()
public String getLastName( )
public String getEmailAddress( )
public abstract int compareTo(Person p);
Student
class variables
int lastIdAssigned // initially set to 20050
instance variables
private int myStudentId
private double myGpa
private double myNumberOfCredits
methods
public void addCourse(int credits, double grade)
public int getStudentId( )
public double getGpa( )
(a)
The Person constructor has
two String parameters,
a first name and a last
name.
The constructor initializes the e-mail address to the first letter
of the
followed by @jc.com.
e-mail address will be the first letter of the first name followed by the
entire last name followed by @jc.com.
first name
followed by the first five letters of the last name
If the last name has fewer than five letters, the
Examples:
Name
Email Address
JSmith@jc.com
JMorri@jc.com
MKey@jc.com
Jane Smith
John Morris
Mary Key
Implement the Person constructor.
Transcribed Image Text:Inheritance and Polymorphism Free Response Questions: Consider the following detailed inheritance hierarchy diagram Person instance variables private String myFirstName private String myLastName private String myEmailAddress methods public String getFirstName() public String getLastName( ) public String getEmailAddress( ) public abstract int compareTo(Person p); Student class variables int lastIdAssigned // initially set to 20050 instance variables private int myStudentId private double myGpa private double myNumberOfCredits methods public void addCourse(int credits, double grade) public int getStudentId( ) public double getGpa( ) (a) The Person constructor has two String parameters, a first name and a last name. The constructor initializes the e-mail address to the first letter of the followed by @jc.com. e-mail address will be the first letter of the first name followed by the entire last name followed by @jc.com. first name followed by the first five letters of the last name If the last name has fewer than five letters, the Examples: Name Email Address JSmith@jc.com JMorri@jc.com MKey@jc.com Jane Smith John Morris Mary Key Implement the Person constructor.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage