Write a program that displays the commission of a salesman using two functions.
ID: 3630817 • Letter: W
Question
Write a program that displays the commission of a salesman using two functions. The first function is called to prompt and get sales amount from user and the sale amount is returned to the main module. The second function is called to calculate the commission and return the value to the main module. The Main Module will display the sales and the commission.Procedure or Details:
The following table is used to calculate the commission:
Sale Amount Commission
---------------- ---------------------------
0 – 999 3.5%
1000 – 1999 4.0%
2000 – 2999 4.5%
3000 or above 5.0%
Explanation / Answer
/*this is a sample c program*/ #include float prompt(void) // function 1 to prompt and take input { float amount; printf("Enter the amount "); scanf("%f",&amount); return amount; } float commission(float amount) // function 2 to calculate commission { float comsn; if(amountRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.