1)(a) Write down the difference between automatic type conversion and type casting? Also, provide a appropriate C++ code to demonstrate both.
(b) Which C++ header file(s) will be fundamentally needed to be included to run/ execute the following C++ code?
void main( )
{
int Eno=123, char Ename[ ]=”Rehan Swamp”;
cout<}
2)(a) What do you mean by Polymorphism.? Also, provide the example in C++ to demonstrate the same
(b) Answer the questions given below based on the following:
class Chairperson
{
long CID; //Chairperson Identification Number
char CName[20];
protected:
char Description [40];
void Allocate();
public:
Chairperson();
void Assign();
void Show();
};
class Director
{
int DID; //Director ID
char Dname[20];
protected:
char Profile[30];
public:
Director();
void Input();
void output();
};
class Company: private Chairperson, public Director
{
int CID; //Company ID
char City[20], Country[20];
public:
Company();
void Enter();
void Display();
};
(i) Which kind of inheritance out of the following is specifically is demonstrated in the above C++ code?
(a) Single Level Inheritance
(b) Multi Level Inheritance
(c) Multiple Inheritance
(ii) Write down the names of data members, which are accessible by objects of class type Company.
(iii) Write down the names of all member functions that are accessible by objects of class type Company.
(iv) Write down the names of all members that are accessible from member functions of class Director.