Important Questions

CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By Naveen Gupta

CBSE CLASS XII

d. Answer the questions (i) to (iv) based on the following code:
class company
{ char Cname[25];
protected: char Hoffice[25];
public : company();
char Country[25];
void EnterDate();
void DisplayData();
};

class delhi:public company
{ long NOE;
char Ctry[25] ;
protected: void Association();
public: delhi();
void Add();
void Show();
};

class mcdonald:public delhi
{ char State[25];
public: mcdonald();
void Enter();
void Output();
};

  1. Which class’s constructor will be called first at the time of declaration of an object of class mcdonald.
  2. How many bytes an object belonging to class delhi require?
  3. Name the member function(s) which are accessed from the object(S) of class mcdonald.
  4. Name the Data members which are accessible from the objects(s) of class delhi.

Q. 4. a. Rewrite the following program after removing syntactical error(s) if any. Underline each correction.

struct group
{
int x1,x2;
}
void main()
{
g1,g2 group;
cin>>g1.x1<<g2.x2;
g2=g1;
cout<<g2.x2<<g2.x1<<endl;
2+=g1.x1;
cout<<g1.x1<<g1.x2;
}
b. Explain the typedef user defined datatype.

Q. 5. a. Following is the structure of each record in a data file named “Colony.dat”

struct Colony
{
char colony_code[10];
char colony_name[10];
int no_of_people;
};

Paper By Mr. Naveen Gupta
Email Id : [email protected]