One chemical company pays its sales people on a commission basis. The sales peop
ID: 3724611 • Letter: O
Question
One chemical company pays its sales people on a commission basis. The sales people receive $200/ week plus 9% of their gross sales for that week. For example, a sales person who sells $5,000.00 worth of chemicals will receive $200 plus the 9% of $5,000 for a total of $650.
Develop a program that will input a sales person gross sales an will calculate and display that person's earnings.
Example of an output: Salary is : $650.00
Be sure that in your program you consider the following:
Your program includes:
1. proper case, variable names(meaningful and use conventions)
2. proper organization, indentation, white space, and comments
3. Has the right inputs and outputs, computes correct results. That includes the correct formatting for the output, since is currency you have to indicate the currency symbol
Explanation / Answer
#include<iostream>
#include<iomanip>
using namespace std;
// main function definition
int main()
{
// Local variable to store gross salary
double grossSales;
// Local variable to store salary
double salary;
// Accepts gross sales
cout<<" Enter the gross sales for a week: $";
cin>>grossSales;
// Calculates salary
salary = 200 + (.09 * grossSales);
// Displays salary with two decimal places
cout<<" Salary is: $"<<setprecision(2)<<fixed<<salary;
}// End of main function
Sample Output 1:
Enter the gross sales for a week: $5000.00
Salary is: $650.00
Sample Output 2:
Enter the gross sales for a week: $8000.00
Salary is: $920.00
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.