Here is the C++ code to convert following flowchart into c++ code . It takes input for user's salary and calculate the increased salary. You all should have in mind how it works exactly. Here is the algorithm.
Steps
User side
1: User asked to enter salary.
2: Screen displays the increased salary.
Developer side
1: Declare variables that are going to be used in program .
2: Input the enter salary from user.
3: Calculate the increase in salary by using following statement: setincrease=salary*.045;
4: Calculate the total salary of user by adding the original salary and increased.
5: Display the salary.
6: Program ends here.
Code:
#include <iostream>
using namespace std;
int main()
{ int salary;
float setincrease,increasedsalary;
cout<<"Enter ypur salary";
cin>>salary;
setincrease=salary*.045;
increasedsalary=salary+setincrease;
cout<<"Increased salary is=
"<<increasedsalary<<endl;
system("pause");
return 0;
}
Output:
Comments
Post a Comment