149k views
0 votes
XYZ is a well-renowned company that pays its salespeople on a commission basis. The salespeople each receive 700 PKR per week plus 9% of their gross sales for that week. For example, a salesperson who sells 4000 PKR worth of chemicals in a week receives 700 plus 9% of 5000 PKR or a total of 1060 PKR. Develop a C++ program that uses a Repetitive Structure (while, for, do-while) to manipulate each salesperson’s gross sales for the week and calculate and displays that salesperson’s earnings.

User Arne
by
8.3k points

1 Answer

1 vote

Answer:

#include<iostream>

#include<conio.h>

using namespace std;

float calculateGross(float sale)

{

return (sale/100*9) + 700;

}

main()

{

float sale[3] = { 5000,7000,9000}, Totalsale =0;

for(int i=0; i<=2; i++)

{

cout<<"Sales Person "<<i+1<<" Gross Earnings: "<<calculateGross(sale[i])<<" PKR\\";

Totalsale += calculateGross(sale[i]);

}

cout<<"Total Gross Sales Earnings for week: "<<Totalsale<<" PKR\\";

return 0;

}

User PBelanger
by
8.5k points