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 teacher:
Program is to define a class as teacher and collect information about them by using classes and object
class teacher
{
private:
char name[20];
char sub[10];
float basic,hra,da;
float salary;
int calculate()
salary=basic+hra+da;
return salary;
}
public:
void readdata();
void dispdata();
};
void teacher::readdata()
clrscr();
cout<<" enter your name "<<"\n";
gets(name);
cout<<" enter the subject you teach "<<"\n";
cin>>sub;
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 teacher::dispdata()
cout<<" the name is :"< cout<<" the subject you teach is :"< calculate(); cout<<" the salary you get is : "< } void main() { clrscr(); teacher info; info.readdata(); info.dispdata(); }
cout<<" the subject you teach is :"< calculate(); cout<<" the salary you get is : "< } void main() { clrscr(); teacher info; info.readdata(); info.dispdata(); }
calculate();
cout<<" the salary you get is : "< } void main() { clrscr(); teacher info; info.readdata(); info.dispdata(); }
void main()
teacher info;
info.readdata();
info.dispdata();
A: No. (Excluding if you have an old compiler, you might have to force the new operator to throw an exception if it runs out of memory.) This turns out to be a real pain to alwa
replace character into string and return value of string that are replaced
Public derivation Public derivations are much more common than private derivations. In this situation: The private members inherited from the base class are inaccessible
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. #include float start_point,
What is a newline escape sequence? - A newline escape sequence is signified by the \n character. - It is used to insert a new line whereas displaying the output data. - T
Object Conversions Just like initialization, conversions are also done automatically when an object of a derived class is assigned to an object of the base class. Though, the c
c++ program to to implement multiple stacks using single array
Inline Functions Imagine a c program, which reads disk records having employee information. If this is a payroll application each employee record data is probably processed by
convert BST into sorted doubly linked list
Introduction to C++ C++ was developed by Bjarne Stroustrup at Bell Laboratories in 1983. Originally, it was known as " C with class". C+ as an enhancement to the C language was
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