QuesAns Print Page – CSKC
Sign In

Search

siteicon
Q&A CBSE12A-2019-A02D-C2 #6985

Question:

Consider the following class HeadQuarter

class HeadQuarter
{
  int Code;
  char Des[20];
protected:
  char Address[40];
public:
  void Get() {cin>>Code;gets(Des);gets(Address);}
  void Put() {cout<<Code<<Des<<Address<<endl;}
};

Write a code in C++ to protectedly derive another class FrontOffice From the base class HeadQuarter with following members.

Data Members

Location of type character of size 10

Budget of type double

Member Functions

A constructor function to assign budget as 100000

Assign() to allow user to enter Location and Budget

Display() to display Location and Budget