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

Class and object, how to write c++ code for financial system using class an...

how to write c++ code for financial system using class and object

Develop an auto-click bot, What I need is an auto-click bot. The auto-click...

What I need is an auto-click bot. The auto-click bot would ask me for a url(or it would be pre-defined too) so that it loads that specific url and click an ad automatically. This w

Bubble sort, sample of program that use in bubble sort using assignment ope...

sample of program that use in bubble sort using assignment operator in c++

Design test program that tests the student, This is a test program that tes...

This is a test program that tests the Student and ITECH7603Class classes.     In this assignment you are provided with three input text files associated with this program:

Described inline function?, A: The inline keyword tells the compiler to sub...

A: The inline keyword tells the compiler to substitute the code in the function de_nition for each instance of a function call. Though, substitution takes place only at the compile

Function that have parameter and makes an integer mask, Write a function th...

Write a function that has an int parameter n, makes an integer mask having the bit 1 at the nth place from the rightmost bit, and returns the mask. For example, when n = 5 is passe

Srand and rand(), Mention clearly about srand and rand().

Mention clearly about srand and rand().

Define variable declaration in c++, Variable Declaration This declarati...

Variable Declaration This declaration of variables in the C language is permitted only in the starting of their block, prior to executable program statements. In C++ declaratio

Area under the curve, Write a program to find the area under the curve y = ...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Logical operators, how can i make a program with !(not) operator

how can i make a program with !(not) operator

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