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 A) Implement the person constructor:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

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

A) Implement the person constructor:


B) 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.

 

C) Write both the Person and Student class headers so that the Student is a subclass of Person. 

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT