Write a program for Calculating the Monthly Salary of
employee after his Absent on working days
·
Ask name from user
·
Ask Total Working Days
·
Ask Total Absent Days
·
Get Monthly Salary in %
h Using Functions For every Method
****************************************************************************************************************************************************************************************************************
kjj#include<iostream>
float number();
// showing there
float absent(float);
// are only 3
float averag(float);
// functions used
using namespace std;
int main()
{
float x;
float y;
float avg;
x=number();
y=absent(x);
avg=averag(y);
cout<<"Worker should get
"<<100-avg<<" % Salary"<<endl;
cout<<"This Month
"<<endl;
return 0;
}
float number()
{
int Twd;
string Name;
cout
<<"enter the name of employee "<<endl;
cin>>Name;
cout<<"Enter the Total Working
Days\n";
cin>>Twd;
return Twd;
}
float absent(float Twd)
{
float Tad;
float
div;
cout<<"Enter the total absent days of employees\n";
cin>>Tad;
div=(Tad/Twd);
return div;
}
float averag(float div)
{
float Avg;
cout<<"The average is
"<<endl;
Avg=div*100;
cout<<Avg<<endl;
return Avg;
}
****************************************************************************************************************************************************************************************************************
OUTPUT:
NOTE: Programming Fundamental In BsCs
Comments
Post a Comment