C program to create, update & display account & admin, C/C++ Programming

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;

            public:

            void getdata();

            void displaydata();

};

 

class admin : public virtual person

{

            int experience;

            public:

            void getdata();

            void displaydata();

};

 

class master : account, admin

{

            public:

            void getdata();

            void displaydata();

};

 

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

Posted Date: 9/29/2012 4:11:14 AM | Location : United States







Related Discussions:- C program to create, update & display account & admin, Assignment Help, Ask Question on C program to create, update & display account & admin, Get Answer, Expert's Help, C program to create, update & display account & admin Discussions

Write discussion on C program to create, update & display account & admin
Your posts are moderated
Related Questions
write a program that would accept the radius of the sphere and return its surface area.

C++ Multiplayer Game Programming Project Project Description: We are seeking an experienced C++ Game Programmer to enhance clientside related aspects of MCS: Mars City Securi

Flash my terminal vx670 Project Description: Have VeriFone software need it to communicate with the vx670 through com port 1 it is not talking I'm not sure why have all the r

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.

Write a Program that illustrate Command Line Parameters? main(int argc, char *argv[]) { int i; for(i = 0; i printf("arg %d: %s\n", i, argv[i]); return 0; }

enter height of the shape: 1 3 5 3 1 3 5 7 5 3 5 7 9 7 5 3 5 7 5 3 1 3 5 3 1

Set of Integers) Create class IntegerSet. Each IntegerSet object can hold integers in the range 0-100. The set is represented by an array of bools. Array element a[i] is true if in

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

Describe Processing an array? The Single operations which involve complete arrays are not permitted in C language. therefore if a and b are similar arrays (for example same dim

Develop G-code generating software Project Description: I'm presently using Slicer on a polymer jetting 3d printer. The toolpaths were thought out for FDM printers and thus a