Given that an EMPLOYEE class contains following members:
Data members : Employee_Number, Employee_Name, Basic,
DA,
IT, Net_Salary
Member functions: to read the data, to calculate Net_Salary and to
print data members.
Write a C++ program to read the data of N employees and
compute Net_Salary of each employee.
(Dearness Allowance (DA) = 52% of Basic and Income Tax (IT) = 30% of
the gross salary. Net_Salary = Basic + DA - IT)
#include<iostream.h>
#include<conio.h>
#define SIZE 5
class emp
{
float basic,da,it,netsal;
char name[20],num[10];
public:
void getdata();
void net_sal();
void dispdata();
};
void emp::getdata()
{
cout<<"\n Enter employee number: " ;
cin>>name;
cout<<" Enter employee name: " ;
cin>>num;
cout<<"Enter employee basic salary in Rs: " ;
cin>>basic;
}
void emp::net_sal()
{
da=((0.52)*basic );
float gsal=da+basic;
it=((0.3)*gsal);
netsal=gsal-it;
}
void emp::dispdata()
{
cout
<<"\n Employee number: "<<name
<<"\n Employee name: "<<num
<<"\n Employee netsalary: "<<netsal<<" Rs.";
}
void main()
{
clrscr();
emp ob[SIZE];
int n;
cout<<"\n\n***********************************"
<<"\nCalculation of Employee Net Salary"
<<"\n***********************************"
<<"\n Enter the number of employees";
cin>>n;
for(int i=0;i<n;i++)
{
ob[i].getdata();
ob[i].net_sal();
}
clrscr();
cout<<"\n-----------------"
<<"\nEmployee Detail::"
<<"\n-----------------";
for( i=0;i<n;i++)
{
cout<<"\n\n Employee:"<<i+1
<<"\n ----------";
ob[i].dispdata();
}
getch();
}
OUTPUT
thanks ☺
ReplyDeleteWrite a program to make a calculator by operator in not argument nor return function .help me
ReplyDeleteThis comment has been removed by the author.
ReplyDeletegive me a program which make the odd numbers 1 to 100
ReplyDeletehttps://programscpp.blogspot.com/2018/12/blog-post.html
Deletewrite a c++ program to calculate family income using friend function please suggest me
ReplyDeleteThanks
ReplyDeletegive me the coding if salary is 3000 and the absent days of employee is 10 days and total salary is 2000
ReplyDeletegive me the coding if salary is 3000 and the absent days of employee is 10 days and total salary is 2000
ReplyDeletehttps://d2498fijg8ztfy3etotznbpl9t.hop.clickbank.net/?tid=MATBIN
ReplyDelete(b). Employees of a certain firm are paid on hourly basis at the end of each week. If an employee works up to 40hrs the employee is paid 6 cedis and 7 cedis per hour for a male and female respectively.
ReplyDeleteIf an employee works for more than 40 hours then the employee is also paid 1.5 the corresponding regular rate for hours worked in excess of 40. All employees are to pay 15 % of their gross as INCOME TAX and 5% towards the NHIS. If an employee has more than 3 children then he or she pays 2 cedis per child in excess of three towards GETFUND.
Write a C++ program in can output an employee’s gross pay, various deduction (INCOME TAX, NHIS,GETFUND) and the NET PAY with appropriate caption. (You are required to use user-defined functions for all the outputs and the deductions).
(b). Employees of a certain firm are paid on hourly basis at the end of each week. If an employee works up to 40hrs the employee is paid 6 cedis and 7 cedis per hour for a male and female respectively.
ReplyDeleteIf an employee works for more than 40 hours then the employee is also paid 1.5 the corresponding regular rate for hours worked in excess of 40. All employees are to pay 15 % of their gross as INCOME TAX and 5% towards the NHIS. If an employee has more than 3 children then he or she pays 2 cedis per child in excess of three towards GETFUND.
Write a C++ program in can output an employee’s gross pay, various deduction (INCOME TAX, NHIS,GETFUND) and the NET PAY with appropriate caption. (You are required to use user-defined functions for all the outputs and the deductions).
1. Write a c++ program that compute the Income, Deduction and net payment of employee for a given salary.
ReplyDeleteLearning from knowledgeable instructors can make a significant difference. Their ability to explain complex topics and provide real-world examples is invaluable.click here for more information.
ReplyDelete