Categories
- 4th semester (27)
- 5th semester (3)
- ADA (13)
- Assembly Level Language (12)
- BE (45)
- C Language Programming (5)
- C language (20)
- C++ Language (5)
- CCP Lab programing (3)
- Computer Programming Lab (3)
- DAA Lab Programming (13)
- Data Structure and C++ laboratory Program (6)
- Data Structure and C++ labotary Program (5)
- Design and Analysis of algorithm (14)
- First Year (5)
- MASM (12)
- Microprocessor (12)
- Microprocessor lab program (12)
- System Software & OS Laboratory (5)
- Unix program (4)
- bachelor of engineering (30)
- basic (1)
- basic mathematics (2)
- beginners (10)
- c++ program (9)
- calculations (7)
- computer science (30)
- downloadable (5)
- engineering syllabus (4)
- simple program (6)
Trend Posts
Blogger news
Author
Followers
Showing posts with label employee. Show all posts
Showing posts with label employee. Show all posts
Wednesday, September 25, 2013
Design,develop and execute the c++ program according to the below instructions:
An employee class is to contain following datamembers and memer functions:
data member:
empolyee_number
employee_name
basic_salary
all_alavances
it(income tax)
net_salary
member functions:
to read data of an emplyee
to calculate salary
to print value of all data memebers
hints:
all_alavances=120% of basic salary
it=30% of gross salary
net salary=basic salary+all_alavances-income tax
gross salary=basic salary+all_alavances
An employee class is to contain following datamembers and memer functions:
data member:
empolyee_number
employee_name
basic_salary
all_alavances
it(income tax)
net_salary
member functions:
to read data of an emplyee
to calculate salary
to print value of all data memebers
hints:
all_alavances=120% of basic salary
it=30% of gross salary
net salary=basic salary+all_alavances-income tax
gross salary=basic salary+all_alavances
---------
#include<iostream.h>
#include<conio.h>
#define MAX 2
class employee
{
int employee_number;
char employee_name[15];
int basic_salary;
int all_alavances;
int it;
int net_salary;
public:
void read()
{
cout<<"enter the employee number"<<endl;
cin>>employee_number;
cout<<"enter the employee name"<<endl;
cin>>employee_name;
cout<<"enter the basic salary"<<endl;
cin>>basic_salary;
}
void calc()
{
int gross;
all_alavances=(basic_salary*120)/100;
gross=basic_salary+all_alavances;
it=(gross*30)/100;
net_salary=gross-it;
cout<<"calaculated"<<endl;
}
void print()
{
cout<<employee_number<<"\t"<<employee_name<<"\t"<<basic_salary<<"\t"<<all_alavances<<"\t"<<it<<"\t"<<net_salary<<endl;
}
};
void main()
{
int i;
employee a[MAX];
clrscr();
for(i=0;i<MAX;i++)
{
a[i].read();
a[i].calc();
}
cout<<"employee number|empolyee name|basic salary|all alavances|income tax"<<"\t"<<"net_salary"<<endl;
for(i=0;i<MAX;i++)
{
a[i].print();
}
getch();
}
#include<iostream.h>
#include<conio.h>
#define MAX 2
class employee
{
int employee_number;
char employee_name[15];
int basic_salary;
int all_alavances;
int it;
int net_salary;
public:
void read()
{
cout<<"enter the employee number"<<endl;
cin>>employee_number;
cout<<"enter the employee name"<<endl;
cin>>employee_name;
cout<<"enter the basic salary"<<endl;
cin>>basic_salary;
}
void calc()
{
int gross;
all_alavances=(basic_salary*120)/100;
gross=basic_salary+all_alavances;
it=(gross*30)/100;
net_salary=gross-it;
cout<<"calaculated"<<endl;
}
void print()
{
cout<<employee_number<<"\t"<<employee_name<<"\t"<<basic_salary<<"\t"<<all_alavances<<"\t"<<it<<"\t"<<net_salary<<endl;
}
};
void main()
{
int i;
employee a[MAX];
clrscr();
for(i=0;i<MAX;i++)
{
a[i].read();
a[i].calc();
}
cout<<"employee number|empolyee name|basic salary|all alavances|income tax"<<"\t"<<"net_salary"<<endl;
for(i=0;i<MAX;i++)
{
a[i].print();
}
getch();
}
Subscribe to:
Posts (Atom)