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!
Aim: To implement a program to create, update & display account & admin record of person using display account & admin records of person using virtual base class..
Code:
class person
{
int code;
char name[20];
public:
void getdata();
void displaydata();
};
class account: public virtual person
int pay;
class admin : public virtual person
int experience;
class master : account, admin
void person::getdata()
cout<<"\nCode: ";
cin>>code;
cout<<"Name: ";
cin>>name;
}
void account::getdata()
cout<<"Enter Pay: ";
cin>>pay;
void admin::getdata()
cout<<"Enter Experience: ";
cin>>experience;
void master::getdata()
person::getdata();
account::getdata();
admin::getdata();
void person::displaydata()
cout<<"\nEmployee code: "< cout<<"\nName: "< } void admin::displaydata() { cout<<"\nExperience: "< } void account::displaydata() { cout<<"\nPay: Rs."< } void master::displaydata() { person::displaydata(); account::displaydata(); admin::displaydata(); } void main() { int ch; clrscr(); master m1; cout<<"\n\tEnter Details:"; m1.getdata(); cout<<"\n\t**Details Registered Successfully**\n\n"; m1.displaydata(); getch(); } Output: Enter Details: Code: 312 Name: Bella Enter Pay: 320$ Enter Experience: 2 **Details Registered Successfully** Employee code: 312 Name: Bella Pay: 320$ Experience: 2 years
cout<<"\nName: "< } void admin::displaydata() { cout<<"\nExperience: "< } void account::displaydata() { cout<<"\nPay: Rs."< } void master::displaydata() { person::displaydata(); account::displaydata(); admin::displaydata(); } void main() { int ch; clrscr(); master m1; cout<<"\n\tEnter Details:"; m1.getdata(); cout<<"\n\t**Details Registered Successfully**\n\n"; m1.displaydata(); getch(); } Output: Enter Details: Code: 312 Name: Bella Enter Pay: 320$ Enter Experience: 2 **Details Registered Successfully** Employee code: 312 Name: Bella Pay: 320$ Experience: 2 years
void admin::displaydata()
cout<<"\nExperience: "< } void account::displaydata() { cout<<"\nPay: Rs."< } void master::displaydata() { person::displaydata(); account::displaydata(); admin::displaydata(); } void main() { int ch; clrscr(); master m1; cout<<"\n\tEnter Details:"; m1.getdata(); cout<<"\n\t**Details Registered Successfully**\n\n"; m1.displaydata(); getch(); } Output: Enter Details: Code: 312 Name: Bella Enter Pay: 320$ Enter Experience: 2 **Details Registered Successfully** Employee code: 312 Name: Bella Pay: 320$ Experience: 2 years
void account::displaydata()
cout<<"\nPay: Rs."< } void master::displaydata() { person::displaydata(); account::displaydata(); admin::displaydata(); } void main() { int ch; clrscr(); master m1; cout<<"\n\tEnter Details:"; m1.getdata(); cout<<"\n\t**Details Registered Successfully**\n\n"; m1.displaydata(); getch(); } Output: Enter Details: Code: 312 Name: Bella Enter Pay: 320$ Enter Experience: 2 **Details Registered Successfully** Employee code: 312 Name: Bella Pay: 320$ Experience: 2 years
void master::displaydata()
person::displaydata();
account::displaydata();
admin::displaydata();
void main()
int ch;
clrscr();
master m1;
cout<<"\n\tEnter Details:";
m1.getdata();
cout<<"\n\t**Details Registered Successfully**\n\n";
m1.displaydata();
getch();
Output:
Enter Details:
Code: 312
Name: Bella
Enter Pay: 320$
Enter Experience: 2
**Details Registered Successfully**
Employee code: 312
Pay: 320$
Experience: 2 years
#include #include #include using namespace std; #define MAX 5 #define INF (1 #define DEBUG if(0) #define pii pair #define pb(x) push_back(x) class
Virtual Functions The keyword virtual was previously used to resolve ambiguity for a class derived from two classes, both having a common ancestor. These classes are known as v
To implement a back account system for new users
Design a game in c: const DODGERS = 0; const GIANTS = 1; void main(void) { int scoreboard [2][9]; // An array two rows by nine columns int team, i
Simpson's Rule is a more accurate method of numerical integration than the method described in class. Using Simpson's Rule, the integral of a function f between a and b is approxim
Project Description: Boots capture video from your YouTube channel and upload your own video to our channel or the copyright of the videos, bang, 3 parties, automatically delete
Is it legal for a member function to say delete this? A: As long as you're cautious, it's OK for an object to delete this. Here's how I define "cautious": You have to be a
how do I randomised numbers in an array?
write a java program padovan string program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring; public class Pado
Program is to read the characters from keyboard: Program is to read the characters from keyboard one by one stored in different files as upper constants, lower constants, othe
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: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd