eclare a class called item having data members item_code, item_name, cost and discount. Derive two classes from class item, namely employee and customer. The class employee has data members like employee_code, employee_name and amount. The class customer has data members like customer_name and amount. Define following functions for - initializing data members. - displaying the values of data members. - computing amount to be paid for a purchased item. Also define function main to create objects of both derived classes and to show usage of above functions.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter11: Introduction To Classes
Section11.2: Basic Class Functions
Problem 10E
icon
Related questions
Question

Declare a class called item having data members item_code, item_name, cost and discount.
Derive two classes from class item, namely employee and customer. The class employee has data
members like employee_code, employee_name and amount. The class customer has data
members like customer_name and amount. Define following functions for - initializing data
members. - displaying the values of data members. - computing amount to be paid for a
purchased item. Also define function main to create objects of both derived classes and to show
usage of above functions.

 

 

 

Expert Solution
steps

Step by step

Solved in 4 steps with 6 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
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