Create a Person class for a user of the system. Create person.h and person.cpp files for this class. The class should contain the following data of a person in the system: • first name, • last name, • user ID, and • email address. These data should be accessible in its derived class. (Consider should the data be private, public, or protected?) This class should contain: • a default constructor, • a value constructor that receives all of the data to be placed into the data members as its parameters, • a copy constructor. The class should also contain: • “get” methods to allow the client to obtain information about a person. o getFirstName, getLastName, getID, getEmail • “set” methods to allow the client to assign information to a seller. o setFirstName, setLastName, setID, setEmail, and optionally setAllInfo • overloaded operators o overloaded == method that returns true if two sellers have identical names and email address; otherwise it returns false. o overloaded !=, <, and > operators (for > and < operators, comparisons are based on last names) • An overloaded assignment = operator. • Overloaded << and >> operators (consider should these be friend functions?) • print() – a virtual function that displays on screen all the information of a person with appropriate messages • read() – a virtual function that reads in the information of a Person from an input file stream Consider which of these methods should be const method?

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 5RQ
icon
Related questions
Question

Create a Person class for a user of the system. Create person.h and person.cpp files for this class.
The class should contain the following data of a person in the system:
• first name,
• last name,
• user ID, and
• email address.
These data should be accessible in its derived class. (Consider should the data be private, public,
or protected?)
This class should contain:
• a default constructor,
• a value constructor that receives all of the data to be placed into the data members as its
parameters,
• a copy constructor.
The class should also contain:
• “get” methods to allow the client to obtain information about a person.
o getFirstName, getLastName, getID, getEmail
• “set” methods to allow the client to assign information to a seller.
o setFirstName, setLastName, setID, setEmail, and optionally setAllInfo
• overloaded operators
o overloaded == method that returns true if two sellers have identical names and
email address; otherwise it returns false.
o overloaded !=, <, and > operators (for > and < operators, comparisons are based
on last names)
• An overloaded assignment = operator.
• Overloaded << and >> operators (consider should these be friend functions?)
• print() – a virtual function that displays on screen all the information of a person with
appropriate messages
• read() – a virtual function that reads in the information of a Person from an input file stream
Consider which of these methods should be const method?

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,