63 200
Assignments Done
99,3%
Successfully Done
In July 2018

Answer to Question #1286 in C++ for samali

Question #1286
Write a program that reads an employee name, salary and degree. Then increase the salary as following :
& & & & & & & & degree & & & increase&
& & & & & & & & 1 & & & & & & 70%
& & & & & & & & 2 & & & & & & 50%
& & & & & & & & 3 & & & & & & 30%
& & & & & & & & 4 & & & & & & 15%
& & & & & & & & &
& Print the name and the new salary for any input ?
Expert's answer
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout<<"Enter employee name (1 word), salary and degree
->";
string name;
double salary;
int degree;

cin>>name>>salary>>degree;
switch (degree)
{
case 1: salary*=1.7; break;
case 2: salary*=1.5; break;
case 3: salary*=1.3; break;
case 4: salary*=1.15; break;
default: cout<<"Wrong degree
";
}
cout<<name<<" "<<salary<<endl;
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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions