10th October 2012 12:40 PM | |
Saksham | Re: VTU Lab Programs For BE Here I am giving you Lab program of OOPs subject as given below:- Write a c++ program to read the data of N employees & compute net salary of each employee. #include<iostream.h> #include<iomanip.h> #include<conio.h> class employee { private: int no; char name[20]; float basic,da,it,net; public : employee(); ~employee(); void getdata(); void putdata(); void cal(); }; //constructor employee::employee() { } //destructor employee:: ~employee() { } //member function to input data void employee::getdata() { cout<<"Number:"<<endl; cin>>no; cout<<"Name:"<<endl; cin>>name; cout<<"Basic:"<<endl; cin>>basic; } //member function to do calculation DA, IT and Net salary void employee::cal() { cout<<” Calculating net salary of the employees”<<endl<<endl; da=basic*.52; it=(basic+da)*.30; net=basic+da-it; } //memberfunctiom to output data void employee:utdata() { cout<<no<<”\t” <<name<<”\t” <<basic<<”\t” <<net<<endl<<endl; cout<<"---------"<<endl; } main() { employee e[10]; int i,n; clrscr(); cout<<endl<<"Enter the no of employee n:"; cin>>n; for(i=0;i<n;i++) { cout<<"Enter the information of employee "<<i+1<<endl; e[i].getdata(); } cal(); cout<<endl<<"Employee details:"<<endl; cout<<"-------------------------------------------"<<endl; cout<<” s_num\t\tName\t\t basic\t\t net\n\n”; for(i=0;i<n;i++) e[i].putdata(); getch(); return 0; } ******OUTPUT****** Enter the no of employee n: 2 Enter the information of employee 1 Number: 11 Name: Naveen Basic: 6000 Enter the information of employee 2 Employee num: 12 Employee name: Sundeep Basic salary: 7000 Calculating net salary of the employees Employee details: ------------------------------------------- s_num Name basic net 11 Naveen 6000 6384 ------ 12 Sundeep 7000 7448 ------ If you want to get more program then I am giving you zip file from which you can get more program so please see given below attachment:- (VTU Lab Programs OOPs) |
10th October 2012 11:24 AM | |
madan kumar rai.p | VTU Lab Programs For BE Tell me the procedure of get the information about Visvesvaraya Technological University Lab Programs for BE from net because I want to do lab programs so want to know about this |