One large chemical company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9% of $5000, or a total of $650. Develop a program that will prompt the user for a salesperson’s gross sales and will calculate and display that salesperson's earnings. Process one salesperson's figures at a time, use the sentinel value -1 to terminate the program. A sample input/output dialog for the program is below:
#include <iostream>
using namespace std;
int main(){
int n;
double s = 0;
cout << "Input count of salespeople: "; cin >> n;
for(int i = 0; i < n; i++){
cout << "Input " << (i + 1) << "-salesperson' gross sales: "; cin >> s;
cout << "Earnings: " << (200 + s * 0.09) << "$" << endl;
}
Comments
Leave a comment