PROGRAM DESCRIPTION At ACME Hammers, Inc., salesmen are paid a commission based
ID: 3532230 • Letter: P
Question
PROGRAM DESCRIPTION
At ACME Hammers, Inc., salesmen are paid a commission based on two different factors: whether they are full or part-time, and of course on how much they sell. Part-time salesmen are paid a simple commission on all amounts sold; however, full time salesmen earn a commission that varies based on the amount of sales.
SPECIFIC DIRECTIONS
Write a program that prompts a salesman to enter his/her status and total sales. Compute/display the following: their status; total sales; commission rate applied; the commission ($) earned (the appropriate rate times the sales); and the value of total sales minus commission (basically the company
Explanation / Answer
#include <iostream>
using namespace std;
voidfunc1(int sales);
voidfunc2(int sales);
void main ()
{
int sales;
cout<<"Enter sales amount"<<endl;
cin>>sales;
if(sales < 2000)
func1(sales);
else
func2(sales);
}
void func1(int sales)
{
float comission;
if(sales < 1000)
comission = sales * .035;
else
comission = sales * .04;
cout<<"My comission for a total sale of "<<sales<<" is "<<comission<<endl;
}
void func2(int sales)
{
float comission;
if(sales < 3000)
comission = sales * .045;
else
comission = sales * .05;
cout<<"My comission for a total sale of "<<sales<<" is "<<comission<<endl;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.