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

Assignment Help:

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


Related Discussions:- C program to create, update & display account & admin

#titlethe Average Temperature in Paradise.., Writing and compiling a progra...

Writing and compiling a program from a given Use Case definition. Follow the Average Temperature in Paradise

Is there present a way to force new to allocate memory, Yes. "Memory pools"...

Yes. "Memory pools" are useful in many situations. The bad news is that I'll need to drag you through the mire of how it acts before we talk about all the uses. Firstly, recall

Contacts manager data and image facebook sync, Project Description: coll...

Project Description: collect / modify person records / photo images/ lookup / facebook iphone and ipad App basic function : 1 user will configure facebook connection

Queue - c++ program, Queue - C++ program: Write a program to show the ...

Queue - C++ program: Write a program to show the basic operations on queue. namespace stack {  const int max_size = 200;  char v(max_size);  int top=0;  void pu

Is always the default constructor for fred fred::fred()?, Is always the def...

Is always the default constructor for Fred Fred::Fred()?

Structures, A more advanced data type is the structure; here we can define ...

A more advanced data type is the structure; here we can define a template as a collection of different variables e.g.     struct birthdate   {     int month;     int day;

Primary data type in cpp, What are  P r im a r y D a t a T y p...

What are  P r im a r y D a t a T y p es? Integer can be defined according to the size of the data and it can be modified further by using keyword unsigned and si

#Program, Write a program that accepts two real numbers from a user and a s...

Write a program that accepts two real numbers from a user and a select code. If the entered select code is 1, have the program add the two previously entered numbers and display t

What is the best fit algorithm, The Best fit algorithm: The best fit metho...

The Best fit algorithm: The best fit method occurs the smallest free block whose size is greater than or equivalent to n. An algorithm to get such a block by traversing the whole

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