Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started