Answer to Question #45132 in C++ for rizana ajmal

Question #45132
Write a program which get grade and previous salary, and Calculate increased salary.
Grade 3: Rs. 7,432/=
Grade 07: Rs. 12,955/=
Grade 14: Rs. 15,400/=
Grade 19: Rs. 29,412/=
1
Expert's answer
2014-08-21T03:09:19-0400
#include <iostream>
#include <string>

using namespace std;

int main() {
stringgrade;
int salary;

// Inout
cout << "Enter grade: ";
cin >> grade;
cout << "Enter salary:";
cin >> salary;

// Output
if (grade == "3") {
int incSalary = salary + 7432;
cout << "Increased salary Rs. " << incSalary;
return 0;
}

if (grade == "07") {
int incSalary = salary + 12955;
cout << "Increased salary Rs. " << incSalary;
return 0;
}

if (grade == "14") {
int incSalary = salary + 15400;
cout << "Increased salary Rs. " << incSalary;
return 0;
}

if (grade == "19") {
int incSalary = salary + 29412;
cout << "Increased salary Rs. " << incSalary;
return 0;
}

cout << "There is no gradewith such code!";

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
APPROVED BY CLIENTS