Write a Program in C++ Which Compute the Workers Salary

In this Program we will compute the Monthly Salary of the Workers .We get the Total Number of Hours and then the Hourly Wage . After Multiplying both we get the total Salary of a Worker of a Month.

Source Code 


#include <iostream>
using namespace std;
int main()
{
 int numOfDaysWorked,numOfHrsPerDay;   //Declare the Variable which is used in Programme
 float hourlyWage,totalSalary,perDaySalary; //Declare the Variable which is used in Programme
 char answer;        //Declare the Variable which is used in Programme
 cout<<endl<<endl<<"****************** COMPUTE SALARY ******************"<<endl<<endl;
 do
 {
  cout<<endl<<"Enter Number of Days Worked: ";
  cin>>numOfDaysWorked;     //Input the Number of days of Working
  cout<<endl<<"Enter Number of Hours Per Day: ";
  cin>>numOfHrsPerDay;     //Input the Paid of one day
  cout<<endl<<"Enter Hourly Wage: ";
  cin>>hourlyWage;      // Input the hourly paid
  perDaySalary=hourlyWage*numOfHrsPerDay;
  totalSalary=perDaySalary*numOfDaysWorked;
  cout<<endl<<"Total Salary = "<<totalSalary<<" Rupees"<<endl;
  cout<<endl<<"Do you want to continue (y/n)? : ";  // Do you want to More 
  cin>>answer;
 }while(tolower(answer)=='y');
return 0;
}

Output of the Program


Enter Days and hour and Display Pay

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.

1 comments:

  1. good piece of coding you have for learning

    ReplyDelete