Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class called Sales that has the following private member variables: string product; int quantity; double price; double cost; The class Sales has following

Create a class called Sales that has the following private member variables: string product; int quantity; double price; double cost; The class Sales has following public member functions: void setproduct(string p) // sets the name of the product. string getproduct() // returns the name of that product . void setquantity(int q) // sets the quantity of the item sold void setprice(double pr) // sets the sale price per unit of the item sold void setcost(double c) // sets the cost price of the item sold per unit double getamount() // returns the dollar value of the sale assuming all quantity was sold. double getprofitaftertax(double taxrate) // returns profit after tax. Takes an argument for taxtrate. Taxrate is not a member variable of the Sales class. This argument must be provided by the user when using function: getprofitfatertax Use class Sales in a client program (main function). Create two objects and display the product, sales amount and profit after tax for each object.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions

Question

2. Describe why we form relationships

Answered: 1 week ago