VUsolutions Transferred to AchiKhasi.com

From December 2011, this blog www.VUsolutions.blogspot.com is transferred to http://achikhasi.com/vu/ . So, you may visit http://achikhasi.com/vu/ for latest study related help.

Back to home VUsolutions

VUsolutions Fans Club [join us for MORE solutions]

VUsolutions on Facebook

CS201 Assignment No. 3 solution

Thursday, January 06, 2011 Posted In Edit This
#include<iostream.h>
#include<string.h>
#include<conio.h>

class calsalary
{
private:
int empID,empGrade;
char empName[20];
int salary;
public:
calsalary()
{
empID=0;
empGrade=0;
strcpy(empName," ");
salary=0;
}
void getData()
{
cout<<"please enter employee ID:";
cin>>empID;
cout<<"Please enter employee Name:";
cin>>empName;
cout<<"Please enter employee Grade:";
cin>>empGrade;
}
int calculate(int grade)
{
switch(grade)
{
case 17:
salary=15000+(15000*45/100);
break;
case 18:
salary=20000+(20000*45/100);
break;
case 19:
salary=25000+(25000*45/100);
break;
default:
cout<< "Your typed Grade in not listed";
break;
}
return salary;
}
void setData()
{
cout<<"The net salary of" <<empName << " is Rs." <<calculate(empGrade)<<endl;
}

~calSalary()
{
}
};
int main(void) 
{
calSalary obj1;
obj1.getData();
obj1.setData();

system("pause");
return 0;
}

.....................
#include<iostream.h>
#include<conio.h>
#include<string.h>
using namespace std;
class CalSalary
{private:
int EID, EGrade;
string Name; 
public:
CalSalary()
{EID=0;
EGrade=0;
Name='/0';}
void GetInput()
{cout<<"please enter employee name : ";
cin>>Name;
cout<<"please enter employee ID : ";
cin>>EID;
cout<<"please enter employee Grade : ";
cin>>EGrade;}

int GetID()
{return EID;}
void SetID(int ID)
{EID=ID;}
int GetGrade()
{return EGrade;}
void SetGrade(int Grade)
{EID=Grade;}
string GetName()
{return Name;}
void SetName(string N)
{Name=N;} 
void Calculate(int G)
{switch(G)

{case 17:
{cout<<endl<<"The Net salary of "<<Name<<" Is Rs."<<21750<<endl;
break;}
case 18:
{cout<<endl<<"The Net salary of "<<Name<<" Is Rs."<<29000<<endl;
break;} 
case 19:
{cout<<endl<<"The Net salary of "<<Name<<" Is Rs."<<36250<<endl;
break;}
default : 
cout<<"Grade of Employee is incorrect"<<endl;

}
}

}; 
main()
{ int G=0;
CalSalary cal;
cal.GetInput();
G=cal.GetGrade();
cal.Calculate(G);
getch();
}

.............
#include<iostream.h>
#include<conio.h>
#include<string.h>
using namespace std;
class CalSalary
{private:
int EID, EGrade;
string Name;
public:
CalSalary()
{EID=0;
EGrade=0;
Name='/0';}
void GetInput()
{cout<<"please enter employee name : ";
cin>>Name;
cout<<"please enter employee ID : ";
cin>>EID;
cout<<"please enter employee Grade : ";
cin>>EGrade;}

int GetID()
{return EID;}
void SetID(int ID)
{EID=ID;}
int GetGrade()
{return EGrade;}
void SetGrade(int Grade)
{EID=Grade;}
string GetName()
{return Name;}
void SetName(string N)
{Name=N;} 
void Calculate(int G)
{switch(G)

{case 17:
{cout<<endl<<"The Net salary of "<<Name<<" Is Rs."<<21750<<endl;
break;}
case 18:
{cout<<endl<<"The Net salary of "<<Name<<" Is Rs."<<29000<<endl;
break;} 
case 19:
{cout<<endl<<"The Net salary of "<<Name<<" Is Rs."<<36250<<endl;
break;}
default :
cout<<"Grade of Employee is incorrect"<<endl;

}
}

};
main()
{ int G=0;
CalSalary cal;
cal.GetInput();
G=cal.GetGrade();
cal.Calculate(G);
getch();
}

..............

Back to home VUsolutions

Shaadi.com: Just create ur account & find ur partner or EARN money, its reall & EASY

VUsolutions Followers (Join NOW and Get Extra Benefits)

Install LATEST toolbar having lot of features - GET solutions on Desktop

toolbar powered by Conduit
Caliplus 300x250 NoFlam VitoLiv 468x60 GlucoLo