68 319
Assignments Done
99%
Successfully Done
In November 2018

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/=
Expert's answer
#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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions