Assignment Instructions

In this program, you will implement a simple inheritance relation between office items. We have the parent class “Item” and three child classes: “Pen”, “Folder”, and “Paper”. You will implement these 4 classes. Details of each class is given below: Class: Item Int ID Int Type Int Price String Name Item(…) virtual void print() float discount Price(float rate) Class: Pen String inkColor float pointSize Class: Folder String color bool expanding Class.

In this program, you will implement a simple inheritance relation between office items. We have the parent class “Item” and three child classes: “Pen”, “Folder”, and “Paper”. You will implement these 4 classes. Details of each class is given below: Class: Item Int ID Int Type Int Price String Name Item(…) virtual void print() float discount Price(float rate) Class: Pen String inkColor float pointSize Class: Folder String color bool expanding Class: Paper String size int quantity Pen…) void print() Folder(…) void print() Paper(…) void print() Item is the base class and it contains all common attributes and functions for all items. Each child class has two extra attributes and one print() function to print that item.

Please note that print() function in the Item class is a virtual function. Your responsibility is to create these four classes. To make your work easier, this time I do not expect you to separate each class into a different file. You will fill the “item.h” file that is provided with homework | description. And this time, I am not expecting an “item.cpp” file. You will write everything in the header file. The main program (main.cpp) will also be provided to you. In the main program, all items are loaded into an item array by reading the file, and each item is printed with its discounted price. You do not need to make any changes on the main.cpp file. Each class has a constructor function and a print function. Print functions should print all features of the item. Please see the next figure for a reference. The discountPricel) function in the item class will calculate a discounted price of that item using the “rate” input. For example if the rate is 0.15, then the function will calculate price*(1-rate) and return result from the function.

 

In this program, you will implement a simple inheritance relation between office items. We have the parent class “Item” and three child classes: “Pen”, “Folder”, and “Paper”. You will implement these 4 classes. Details of each class is given below: Class: Item Int ID Int Type Int Price String Name Item(…) virtual void print() float discount Price(float rate) Class: Pen String inkColor float pointSize Class: Folder String color bool expanding Class

Calculate Price


Price (USD)
$

This assignment has been solved!

Place your order for a custom solution to this or a similar paper.

Why Choose Us For Your Assignment?

Privacy

We value all our customers' privacy. For that reason, all information stays private and confidential and will never be shared with third parties.

Punctuality

With our service you will never miss a deadline. We use strict follow-ups with our writers to ensure that all papers are submitted on time.

Authenticity

We have no tolerance for plagiarism. All papers go through thorough checking to ensure that no assignments contain plagiarism.

Money Back

You feel unsatisfied with your results? No worries. We offer refunds to our customers if any paper is not written according to the instructions.

Clients Love Us

Client #121678
Client #121678
Read More
This is by far the best I have ever scored in a custom essay. I am surprised the writer handled this assignment so well despite the short notice. I will definitely use your service next time.
Client #21702
Client #21702
Read More
When I was recommended to you by my friends, I wasn't sure you could deliver excellent results for Masters research papers until I submitted my first order. I am all yours now.
Client #20730
Client #20730
Read More
Excellent Services! You are the only assignment helper I can rely on. I have worked with many before and your services are exceptional. I have recommended you to my friends and the results are similar.
Client #20387
Client #20387
Read More
I rarely write reviews online but your services are worth promoting. My paper was so urgent I was sure I was gonna miss the deadline but you turned things around. You are awesome!
Client #20189
Client #20189
Read More
I am a satisfied customer. I know I should have given a 5 star because you deserve it but I will give 4.6 because I almost missed a deadline because of a revision. Luckily it was minor and the writer acted promptly.
Client #20187
Client #20187
Read More
Great paper but there is still some room for improvement. I am impressed by your fast responses and how you tacked my concerns professionally. Thank you for being among the few genuine essay writing service providers.
Client #19783
Client #19783
Read More
I can't thank you enough for being a great part of my college life. I recommended you to two more of my friends. I am sure they will be making their orders soon. I love the fact that you offer free pages for referrals. I will be referring a few more and maybe I won't have to pay for my next two paper, LOL.
Previous
Next