Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
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()
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(); }
cout<<" the employee number is :"< calculate(); cout<<" the salary you get is : "< } void main() { clrscr(); employee info; info.readdata(); info.dispdata(); }
calculate();
cout<<" the salary you get is : "< } void main() { clrscr(); employee info; info.readdata(); info.dispdata(); }
void main()
employee info;
info.readdata();
info.dispdata();
what is polymorphism
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
Define Character Input and Output with Files? This is done by using equivalents of putchar and getchar which are called putc and getc. Each one takes an extra argument which id
(a) Write a fragment of code that declares a variable colSp of type ColourSpot, and then moves it to the point (3, -4), and sets its colour to Green. (b) A function QU8 is speci
Program to Open a file in C++: int main() { char ch; ifstream f1 ("OLDFILE.TXT"); ofstream f2 ("NEWFILE.TXT");
A: The procedure of encoding the parameter types along with the function/method name into a unique name is called as name mangling. The inverse procedure is called demangling. F
A: In C++ there is a main difference among a template and a macro. Merely a macro is a string which the compiler replaces along with the value that was defined. For example #define
Define the Data Type Qualifiers in c Language? 1. const 2. volatile const: The const qualifier is used to tell C that the variable value can't change after initialization.
Define global variable in c++ program: How to define a global variable and need of global variable in c++ program. int main() { int m=20; clrscr(); for
After p = new Fred[n], how does the compiler know about n objects to be destructed throughout delete[] p? A: The run-time system hold the number of objects, n, somewhere where
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!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd