C++ Source Code of Program To Calculate Bonus on Salary for Turbo C++ 3.0 IDE / Compiler.
C++ program:
Code of c++:
Source code:
#include<iostream>/* iostream provides basic
input and output services for C++ programs*/
#include<conio.h>
using namespace std;
int main()
// Th execution of program start with the main function
{
float salary,bonus;
int grade;
cout<<"Enter salary of Employee=";
/*cout is used to display
the same statement in the output*/
cin>>salary;
// Cin used to enter a value by the user.
cout<<"Enter grade=";
cin>>grade;
if(grade>=17)
bonus = salary * 60.0/100.0;
else
bonus = salary * 30.0/100.0;
salary = salary + bonus;
cout<<"The Total salary of Employee = "<<salary;
return 0;
}
0 Comments