Programming in c++ (a fortnightly emolument program)
A program that compute and generate bi-weekly payment of staff
#include <iostream>
#include <string>
using namespace std;
int main()
{
// Declared Variables Block
string first, last;
int level, hour;
float totalpay;
//inputs...........
cout<< "Enter employees first and lastname"<<endl;
cin>>first>>last;
cout<<"enter numbers of hours worked:"<<endl;
cin>>hour;
cout<<"enter works level:"<<endl;
cin>>level;
cout<<"......payroll....."<<endl;
cout<<"Employee: "<<first<<" "<<last<<endl;
cout<<"level: "<<level<<endl;
if(level<8)
{ int pay=300;
totalpay=pay*hour;
cout<<"employees' pay is "<<totalpay;
}else if(level<11){
int pay=600;
totalpay=pay*hour;
cout<<"workers pay is"<<totalpay;
}else if(level<14)
{ int pay=900;
totalpay=pay*hour;
cout<<"workers pay is "<<totalpay;
}else if(level<15)
{ int pay=1200;
totalpay=pay*hour;
cout<<"workers pay is "<<totalpay;
}else
{ cout<<"invalid entry";
}
}

Comments
Post a Comment