C++ Program one large chemical company pays its salespeople on a commission basis
Object:
One large chemical company pays its salespeople on a commission basis. The salespeople 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 structure to input each salesperson’s gross sales for last week and calculate and display that salesperson’s earnings. Process one salesperson’s figures at a time. C++ projects for beginners with source code
Code:
#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
double sale, com, earn;
while (true)
{
cout<<“Enter Sales in Dollars (-1 to end): “;
cin>>sale;
if(sale== -1)
{
break;
}
com = sale / 100 * 9;
earn = com + 200;
cout<<“Salary is: $”<<earn<<endl;
}
getch();
}
#include<iostream> #include<conio.h> using namespace std; void main() { double sale, com, earn; while (true) { cout<<"Enter Sales in Dollars (-1 to end): "; cin>>sale; if(sale== -1) { break; } com = sale / 100 * 9; earn = com + 200; cout<<"Salary is: $"<<earn<<endl; } getch(); }
Pingback: C++ projects for beginners with source code - Codeboks