Documente Academic
Documente Profesional
Documente Cultură
Year Question
Paper
QUESTION NO
2 (d)
4 Marks
(d) Answer the questions (i) to (iii) based on
the following code : DELHI 2006
class stationary
{
char Type;
char Manufacturer[10];
public:
stationary( );
void Read_sta_details( );
void Disp_sta_details( );
};
class office : public stationary
{
int no_of_types;
float cost_of_sta;
public:
void Read_off_details( );
void Disp_off_details( );
};
class printer : private office
{
int no_of_users;
char delivery _date [10];
public:
void Read_pri_details( );
void Disp_pri_details( ); };
void main( )
{
printer MyPrinter;
}
(i) Mention the member names which are
accessible by MyPrinter declared in main( )
function 1
(ii) What is the size of MyPrinter in bytes ? 1
(iii) Mention the names of functions accessible
from the member function Read_pri_details( )
of class printer. 2
(d) (i) Read_pri_details(), Disp_pri_details()
(1 mark for correct function names)
(ii) 29 bytes OR 33 bytes
class furniture
{
char Type;
char Model[10];
public:
furniture();
void Read_fur_details();
void Disp_fur_details();
};
class sofa : public furniture
{
int no_of_seats;
float cost_of_sofa;
public:
void Read_sofa_details();
void Disp_sofa_details();
};
class office : private sofa
{
int no_of_pieces;
char delivery_date[10];
public:
void Read_office_details();
void Disp_office_details();
};
void main()
{ office MyFumiture; }
(i) Mention the member names which are
accessible by MyFumiture declared in main()
function. 1
(ii) What is the size of MyFumiture in bytes ? 1
(iii) Mention the names of functions accessible
from the member functionRead_office_details()
of class office. 2
(d) (i) Read_office_details
Disp_office_details.
(1 mark for correct names)
(ii) 29 bytes
OR
33 Bytes
(1 mark for correct answer)
(iii) Read_fur_details(),
Disp_fur_details,
Read_sofa_details( ),
Disp_sofa_details( ),
Disp_office_details( )
Read_office_details( ) (Optional)
(2 marks for correct answer)
(d) Answer the questions (i) to (iv) based on the
following code : DELHI 2007 4
class Teacher
{
char TNo[5], TName[20], DeptflO];
int Workload;
protected:
float Salary;
void AssignSal(float);
public:
Teacher( ) ;
void TEntry( ) ;
void TDisplay( );
};
(d) Answer the questions (i) to (iv) based on the
following code : DELHI 2007 4
class Student
{
char Admno[10], SName[20], Stream[10];
protected:
int Attendance, TotMarks;
public:
Student( );
void SEntry( );
void SDisplay( );
};
(d) Answer the questions (i) to (iv) based on the
following code : DELHI 2007 4
class School : public Student, public Teacher
{
char SCode[10], SchName[20];
public:
School ( ) ;
void SchEntry( );
void SchDisplay( );
};
(i) Which type of Inheritance is depicted by the
above example ?
(d) Answer the questions (i) to (iv) based on the
following code : DELHI 2007 4
(ii) Identify the member functiion(s) that cannot be
called directly from the objects of class School
from the following :
TEntry( ) SDisplay( ) SchEntry( )
(iii) Write name of all the member(s) accessible
from member functions of class School.
(iv) If class School was derived privately from
class Teacher and privately from class Student,
then, name the member function(s) that could be
accessed through Objects of class School.
(d) (i) Multiple Inheritance
(1 Mark for correct answer)
(ii) None
OR
All the functions can be called.
(1 Mark for any of the correct answer)
(iii) Data Members: SCode, SchName,
Attendance, TotMarks, Salary
Member Functions: SchDisplay(), SchEntry(),
SEntry(), SDisplay( ), TEntry( ), TDisplay( ),
AssignSal( )
( 1 Mark for all correct members)
NOTE:
· Mention of Constructor functions School(),
Student() and Teacher() to be ignored.
· No marks to be awarded for partially correct
answers
(iv) SchEntry( ),SchDisplay( ).
( 1 Mark for all correct member functions)
NOTE:
· Constructor function School() to be ignored.
· No marks to be awarded for partially correct
answers
(d) Answer the questions (i) to (iv) based on
the following code : OUTSIDE DELHI 2007 4
class Trainer
{
char TNo [5], TName [20], Specialisation [10];
int Days;
protected :
float Remuneration;
void AssignRem (float);
public :
Trainer ( ) ;
void TEntry ( );
void TDisplay ( ); };
(d) Answer the questions (i) to (iv) based on
the following code : OUTSIDE DELHI 2007 4
class Learner
{
char Regno [10], LName [20], Program [10];
Protected :
int Attendance, Grade;
public:
Learner ( );
void LEntry ( );
void LDisplay ( );
};
(d) Answer the questions (i) to (iv) based on
the following code : OUTSIDE DELHI 2007 4
Note:
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(); };
(d) Answer the questions (i) to (iv) based on
the following: DELHI 2010 4
void Input();
void output();
};
class Company: private Chairperson, public
Director
{
int CID; //Company ID
char City[20], Country[20];
(d) Answer the questions (i) to (iv) based on
the following: DELHI 2010 4
public:
Company();
void Enter();
void Display();
};
(i) Which type of inheritance out of the
following is specifically is illustrated in the
above C++ code?
(a) Single Level Inheritance
(b) Multi Level Inheritance
(c) Multiple Inheritance
Ans None
Ans. None
Note:
No marks to be awarded for any
partial/alternative answer Ignore mention
of Constructor(s)
(iv) Write the names of all members, which are
accessible from member functions of class
Factory.
Ans. FID, Address, NOE, Description,
Input(), Output(), Assign(), Show(), Allocate()
(1 Mark for correct answer)
Note:
No marks to be awarded for any partial/
alternative answer Ignore mention of
Constructor(s)
(d) Answer the questions (i) to (iv) based on the
following: DELHI 2011 4
class Student
{
int Rno;
char Name [20] ;
float Marks;
protected:
void Result( ) ;
public:
Student( ) ;
void Register( ); void Display( ) ;
};
(d) Answer the questions (i) to (iv) based on the
following: DELHI 2011 4
class Faculty
{
long FCode;
char FName[20];
protected:
float Pay;
public :
Faculty ( ) ;
void Enter ( ) ;
void Show ( ) ;
};
(d) Answer the questions (i) to (iv) based on the
following: DELHI 2011 4
class Course : public Student, private Faculty
{
long CCode [10]; char CourseName [50] ;
char StartDate[8], EndDate[8] ;
public :
Course ( ) ;
void Commence ( ) ;
void CDetail ( ) ;
};
(d) Answer the questions (i) to (iv) based on the
following: DELHI 2011 4
Note:
No marks to be awarded for any other
alternative answer
Constructor functions to be iqnored
(d) Answer the questions (i) to (iv) based on
the following: OUTSIDE DELHI 2011 4
class Student
{
int Rollno:
char SName[20];
float Marksl;
protected:
void Result ( ) ;
public:
Student ( ) ;
void Enroll ( ) ;void Display ( ) ; } ;
(d) Answer the questions (i) to (iv) based on
the following: OUTSIDE DELHI 2011 4
class Teacher
{
long TCode;
char TName [20];
protected:
float Salary;
public:
Teacher ( );
void Enter ( ) ;
void Show ( ) ;
};
(d) Answer the questions (i) to (iv) based on
the following: OUTSIDE DELHI 2011 4
Member function:
Register(), Enter(), Display(), Haveit(),
Giveit(), Start(), Show(),
(iv) 70
(1 Mark for correct answer)
SAMPLE PAPER 2012 SET I
SAMPLE PAPER 2012 SET I
SAMPLE PAPER 2012 SET I
SAMPLE PAPER 2012 SET I
SAMPLE PAPER 2012 SET I
SAMPLE PAPER 2012 SET II
SAMPLE PAPER 2012 SET II
SAMPLE PAPER 2012 SET II
SAMPLE PAPER 2012 SET II
THANK
YOU