Write a code to implement the base and derived class, C/C++ Programming

Assignment Help:

Study the given hierarchical class diagram and additional information, and answer the questions that follow:

Sale

Company: string

unitPrice: double

qty: int

salesAmt: double

Sale(string, double, int);

getCompany():string;

getUnitPrice():double;

getQty():int;

getSalesAmt():double;

computeRevenue():double;

HardwareSale

installFee: double

hWSale(string, double, int, double)

computeRevenue():double

Sale(string, double, int); 

Constructor  that initializes the respective data members to the pass in values.  salesAmt is set to 0.

getCompany():string;

Returns the company

getUnitPrice():double;

Returns the unit price

getQty():int;

Returns the quantity

getSalesAmt():double;

Returns the sales amount

computeRevenue():double;

Sets  sales amount = unit price * quantity.  Returns this computed value.

hWSale(string, double, int, double)

Invokes the base class constructor and sets install fees accordingly

computeRevenue():double

Sets  sales amount = unit price * quantity + install fees

(a)  Write  the class specification and  code to implement the following classes, fulfilling the given requirements:  

(i)  Sale (base class)

 (ii)  HardwareSale(derived class)


Related Discussions:- Write a code to implement the base and derived class

Introduction of computer and programming concept, Classify computer system ...

Classify computer system according to capacity. How they are different from computers according to the classification of technology. Provide comparative study also.

Create a program for decision structure , Create the following program or p...

Create the following program or propose one of your own. The program must include at least one of each of the following. Decision structure Repetitive structure fu

Writing a c++ program, how can I write a c++ program that generate all evn ...

how can I write a c++ program that generate all evn numbers less than 1000?

Palindrome, Problem : Change to palindrome A palindrome is a string that r...

Problem : Change to palindrome A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your ta

Setup and source code with nice user interface, Virtual Webcam effects - Se...

Virtual Webcam effects - Setup and Source code with Nice User Interface Project Description: I want a similar webcam effects application which can apply effects to webcam fee

Pointers, Pointers are just numbers, representing addresses in memory. You ...

Pointers are just numbers, representing addresses in memory. You can add to and subtract from pointers, for instance. It is pretty easy to make mistakes with pointer math, however,

Wap for basic salary of employees & calculate net salary, WAP TO ACCEPT THE...

WAP TO ACCEPT THE BASIC SALARY OF EMPLOYEES & CALCULATE NET SALARY   #include stdio.h> #include conio.h>   void main() {                    float Basi

Program to check even and odd numbers, Program to check even and odd number...

Program to check even and odd numbers: int main() {                 int  your_number;                 cout                 cin >> your_number;

Linear iterative process, (a) Write a recursive procedure (digits n) that c...

(a) Write a recursive procedure (digits n) that computes the number of digits in the integer n using a linear recursive process. For example, (digits 42) should return 2 and (digit

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd