Implement the Seller class as a derived class of Person class. Create the seller.h and seller.cpp files for this class. The Seller class contains additional data members that hold a seller’s: o average star rating received from the buyers, and o total number of items sold. These data should be accessible by its derived classes. (should these data be private, public, or protected?) The following methods are included in the seller class: • A default constructor and a copy constructor • A constructor that receives all of the data for a seller. (for the constructors, make sure to call the base class constructor as appropriate) • Appropriate get and set functions for the new data in this class • print() – overrides the base class print() to print the base class data and print all additional seller data with appropriate messages. Make sure to call the base class print to print the base class data. • read() – overrides the base class read() to read the base class data and reads all additional seller data items, one data per line in the given order. Make sure to call the base class read to read in the base class data. Here is an example data for a Seller S <- indicate a seller record Joseph <- first name Edmondson <- last name jed2k <- user ID jed2k@apple.com <- email 3.6 <- seller rating 1400 <- total number of items sold

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

Implement the Seller class as a derived class of Person class. Create the seller.h and seller.cpp
files for this class. The Seller class contains additional data members that hold a seller’s:
o average star rating received from the buyers, and
o total number of items sold.
These data should be accessible by its derived classes. (should these data be private, public, or
protected?)


The following methods are included in the seller class:
• A default constructor and a copy constructor
• A constructor that receives all of the data for a seller.
(for the constructors, make sure to call the base class constructor as appropriate)
• Appropriate get and set functions for the new data in this class
• print() – overrides the base class print() to print the base class data and print all additional
seller data with appropriate messages. Make sure to call the base class print to print the
base class data.
• read() – overrides the base class read() to read the base class data and reads all additional
seller data items, one data per line in the given order. Make sure to call the base class
read to read in the base class data.


Here is an example data for a Seller
S <- indicate a seller record
Joseph <- first name
Edmondson <- last name
jed2k <- user ID
jed2k@apple.com <- email
3.6 <- seller rating
1400 <- total number of items sold

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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning