Answer to Question #202389 in C++ for jay

Question #202389

Write a pseudocode that will allow a retail store to process the monthly commission that will be paid to their employees. Your solution will accept the total employees to be processed, and then produce an output showing the commission to be given for each employee, after accepting their name, Taxpayer Registration Number (TRN) and total sales for the month. A 10% commission is given if the total monthly sales is 100,000 or less; however, if the total monthly sales amount exceeds 100,000, the employee gets a commission of 8% of the amount up to and including 100,000 as well as 20% of the amount exceeding 100,000.


1
Expert's answer
2021-06-03T02:27:42-0400
Pseudocode:

Start
	Declare variable totalEmployees as integer
	Declare variable employeeName as string
	Declare variable TRN as string
	Declare variable monthSales as float
	Declare variable monthlyCommission as float
	Get the total employees to be processedy from the user
	for i=0 to totalEmployees step 1 
		 Get the employee name (employeeName) from the user
		 Get the employee Taxpayer Registration Number (TRN) from the user
		 Get the employee sales for the month (monthSales) from the user
		 Set monthlyCommission to monthSales*0.1
		 if monthSales>100000 then
			Set monthlyCommission to 0.08*100000+0.2*(monthSales-100000)		 
		 Display the monthlyCommission
End



C++ code:


#include <iostream>
#include <string>
using namespace std;


int main(){
	int totalEmployees=0;
	string employeeName;
	string TRN;
	float monthSales;
	float monthlyCommission;
	cout<<"Enter the total employees to be processedy: ";
	cin>>totalEmployees;
	cin.ignore();
	//Taxpayer Registration Number (TRN) and total sales for the month.
	for(int i=0;i<totalEmployees;i++){
		 cout<<"Enter the employee name: ";
		 getline(cin,employeeName);
		 cout<<"Enter the employee Taxpayer Registration Number (TRN): ";
		 getline(cin,TRN);
		 cout<<"Enter the employee sales for the month: ";
		 cin>>monthSales;
		 //A 10% commission is given if the total monthly sales is 100,000 or less; 
		 monthlyCommission=monthSales*0.1;
		 //however, if the total monthly sales amount exceeds 100,000, the employee gets a commission of 8% of 
		 //the amount up to and including 100,000 as well as 20% of the amount exceeding 100,000.
		 if(monthSales>100000){
			monthlyCommission=0.08*100000+0.2*(monthSales-100000);	
		 }
		 cout<<"The monthly commission is: "<<monthlyCommission<<"\n\n";
		 cin.ignore();
	}


	system("pause");
    return 0;
}




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog