Saturday, 12 December 2015

Write a program that inputs basic salary and calculate 35% dearness allowness,25% house rent and then display gross salary in c++

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{ float bSalary;
cout<<"Input Basic salary to know Gross salary with 35% allownace & 25% House rent"<<endl;
//prompt to get salary from user;
cin>>bSalary;
//input into the bSalary;
cout<<"35% allownace is "<<bSalary*.35<<endl;
//35% of your basic salary is bSalary*.35
cout<<"25% House Rent is "<<bSalary*.25<<endl;
//same idea
cout<<"Gross Salary = "<<bSalary*(1-(.35+.25));
/*Gross or take-home salary is your base salary multiplied by one minus of .35 and .25, or .4*/
getch();
}

2 comments: