Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Having difficult fixing my c++ project, either in c++11 or c++14. Prompt: One large chemical company pays its salespeople on a commission basis. The salespeople

Having difficult fixing my c++ project, either in c++11 or c++14.

Prompt:

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.

Requirements:

create 2 separate files for this homework assignment. The Sales.h file contains the class Sales. Then the main.cpp

Your program should have one member data named grossSales.

Your program should have a constructor, a get and a set member function for the data.

The result salaries must be displayed in 2 decimal places

Sample run of what it should look like:

Enter sales in dollars (-1 to end):5000 //input

Salary is: 650.00 //output

Enter sales in dollars (-1 to end): 5678 //input

Salary is: 711.02 //output

Enter sales in dollars (-1 to end):-1

Here is what I have and I am having trouble fixing my errors or what I need to fill in:

cpp file:

#include #include "Sales.h" int getmember () { cout<<"Enter sales In dollar(-1to end)"; int grosssales; cin>>grosssales; return grosssales; } int setmember (int grosssales) { int Salary=0; double gross=0.09; while(grosssales!=-1) Salary=(gross*grosssales)+initialsalary; salesCounter++; cout<<"Salary is "<>salary; } void main() { getmember(); setmember(grosssales); }

Sales.h file:

class setmember public: { int grosssales; unsigned int salesCounter=0; int initialsalary=200; int getmember(); int setmember(grossales); }

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

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

Why is it difficult to track the costs of manufactured products?

Answered: 1 week ago

Question

Do they appear to be stressed out?

Answered: 1 week ago

Question

When is it appropriate to use a root cause analysis

Answered: 1 week ago

Question

8. Provide recommendations for how to manage knowledge.

Answered: 1 week ago