Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. One large chemical company pays its salespeople on a commission basis. The salespeople each receive $200 per week plus 9 percent of their gross

1. One large chemical company pays its salespeople on a commission basis. The salespeople each receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9 percent of $5000, or a total of $650. Develop a C++ program that uses a while statement to input each salespersons gross sales for last week and calculates and displays that salespersons earnings. Process one salespersons figures at a time. 2. You must create 3 separate files for this homework assignment. The Sales.h file contains the definition of the class Sales. The Sales.cpp file contains the member-function definitions of the class Sales. The lab2.cpp file contains the main function. 3. You must create 3 separate files as stated above. 4. b) Your program should have one member data named grossSales. 5. c) Your program should have a constructor, a get and a set member function for the data. 6. d) The result salaries must be displayed in 2 decimal places. image text in transcribed this is what i have so far

main.cpp:

#include #include "sales.h" using namespace std;

int main() { sales s;

int mysales, wage;

cout

cin >> mysales;

while ( mysales != -1 ) {

s.setgrosssales(mysales);

wage = s.getgrosssales();

cout

cin >> mysales;

}

return(0); }

sales.cpp:

#include #include "sales.h" using namespace std;

sales::sales() { grosssales=0.0; }

/*double sales::calculate() { return grosssales; }*/

void sales::setgrosssales(double sales) { grosssales=200+sales*0.09; }

double sales::getgrosssales() { return grosssales; }

sales.h:

class sales { public: sales(); //double calculate(); void setgrosssales(double sales); double getgrosssales();

private: double grosssales;

};

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago