Program is to define a class as employee, C/C++ Programming

Assignment Help:

Program is to define a class as employee:

Write a program to define a class as employee and collect information about them by using classes and object

class employee

  {

  private:

    char name[20];

    int empno;

    float basic,hra,da;

    float netpay;

    float calculate()

     {

     netpay=basic+hra+da;

      return netpay;

     }

  public:

     void readdata();

     void dispdata();

  };

 

void employee::readdata()

  {

  clrscr();

  cout<<" enter your name "<<"\n";

  gets(name);

  cout<<" enter the empoyee number "<<"\n";

  cin>>empno;

  cout<<" enter the basic salary "<<"\n";

  cin>>basic;

  cout<<" enter the house rent allowance "<<"\n";

  cin>>hra;

  cout<<" enter the dearance allowance"<<"\n";

  cin>>da;

   }

 

void employee::dispdata()

  {

  clrscr();

  cout<<" the name is :"<

  cout<<" the employee number is :"<

  calculate();

  cout<<" the salary you get is : "<

  }

 

 void main()

  {

  clrscr();

  employee info;

  info.readdata();

  info.dispdata();

  }


Related Discussions:- Program is to define a class as employee

C program to print fibonacci series, C program to print fibonacci series: ...

C program to print fibonacci series: int fibo(long int); void main() {                 long int a=0,n;                 printf ("how many terms\n");

KRPano, I am seeking an expert to create a 360 degree virtual tour in KRPan...

I am seeking an expert to create a 360 degree virtual tour in KRPano for use on PCs, tablets and smartphones. You will be given with panoramas in order to create an advanced KRPano

Describe "this" pointer?, It is a pointer accessible only in the member fun...

It is a pointer accessible only in the member functions of a struct, class or union type. It points to the object for which the member function is called. Static member functions d

Academic expert for genetic algorithm, Academic expert for Genetic Algorith...

Academic expert for Genetic Algorithm Project Description: Seeking academic expert for Genetic Algorithm. Skills required are Academic Writing, Algorithm, C++ Programming,

College, #question.College life is tough. Eating pizza for every meal is h...

#question.College life is tough. Eating pizza for every meal is hitting you hard. You are looking at working out to stay healthy. You found a web site that tells you how many ca

Flowchart, how to define a contanst in a flowchart like we do in c language...

how to define a contanst in a flowchart like we do in c language

Programming, pseudocode for gregorian calendar

pseudocode for gregorian calendar

Program, program to check whether a given point lies inside a rectangle or ...

program to check whether a given point lies inside a rectangle or not

string to palindrome, A palindrome is a string that reads the same from b...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

COMPUTER, THEORY OF A COMPUTER PROGRAMMING

THEORY OF A COMPUTER PROGRAMMING

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd