Question
I am stuck on a c++ project that I am working on. One large chemical company pays its salespeople on a commission basis. The salespeople
I am stuck on a c++ project that I am working on.
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.
sample run:
Enter sales in dollars (-1 to end): 5000
Salary is: 650.00
Enter sales in dollars (-1 to end): 5678
Salary is:711.02
Enter sales in dollars (-1 to end): -1
requirements:
a) You must create 2 separate files, the main .cpp and a Sales.h.
b) Your program should have one member data named grossSales.
c) Your program should have a constructor, a get and a set member function for the data.
d) The result salaries must be displayed in 2 decimal places.
Here is what I have gotten so far:
Main.cpp:
#include #include "Sales.h"
using namespace std;
int main(){ unsigned int salesCounter=0; int salary=200; cout <<"Enter sales in dollars (-1 to end): "; int grossSales; cin >>grossSales; double gross=0.09 while(grossSales!=-1){ salary= (gross *grossSales) + salary; salesCounter++; cout<< "Enter sales in dollars (-1 to end): "; cin>>sale; } if(salesCounter!=0){ } }
I have no idea what do I need for my class and my main class
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