Answer to Question #264953 in C++ for Faiqa gul

Question #264953

Starlight company has revised their employs salaries they had certain criteria on which they decided the total increment value of employee on their salary following


1. 10%increase if he has only worked on company's local project


2.15%increase if he has only worked on company's international projects


3.20%increase if he has worked one company's both local and international projects


Now you are required from to ask your 3 employees there names salary's and calculate the total salary they will get this month


You output should display old salary of each employee and new salary get now he will get

1
Expert's answer
2021-11-12T07:16:29-0500


#include <iostream>
#include <iomanip>
#include <string>


using namespace std;




int main()
{
	int ch;


	for(int i=0;i<3;i++){
		double oldSalary=0;
		double newSalary=0;
		string name;
		cout<<"Enter the employee name "<<(i+1)<<": ";
		getline(cin,name);
		cout<<"Enter the employee salary "<<(i+1)<<": ";
		cin>>oldSalary;


		cout<<"1. Employee has only worked on company's local project\n";
		cout<<"2. Employee has only worked on company's international projects\n";
		cout<<"3. Employee has worked one company's both local and international projects\n";
		cout<<"Your choice: ";
		cin>>ch;


		if (ch==1){
			newSalary=oldSalary+oldSalary*0.1;
		}
		else if(ch==2){
			newSalary=oldSalary+oldSalary*0.15;
		}
		else if(ch==3){
			newSalary=oldSalary+oldSalary*0.20;
		}
		cout<<"\nEmployee "<<name<<" has old salary "<<fixed<<setprecision(2)<<oldSalary<<" and new salary "<<newSalary<<"\n\n";
		cin.ignore();
	}


	cin>>ch;
	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
APPROVED BY CLIENTS