Presentation is loading. Please wait.

Presentation is loading. Please wait.

XII CBSE Previous Year Question Paper QUESTION NO 2 (d) 4 Marks.

Similar presentations


Presentation on theme: "XII CBSE Previous Year Question Paper QUESTION NO 2 (d) 4 Marks."— Presentation transcript:

1 XII CBSE Previous Year Question Paper QUESTION NO 2 (d) 4 Marks

2 (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 {

3 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( ); };

4 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

5 (d) (i) Read_pri_details(), Disp_pri_details() (1 mark for correct function names) (ii) 29 bytes OR 33 bytes (1 mark for correct answer) (iii) Disp_pri_details(), Read_off_details(), Disp_off_details(), Read_sta_details(), Disp_sta_details() (2 marks for all correct member functions) Note: No partial marks to be given for any of the parts. Ignore the constructor and function itself

6 (d) Answer the questions (i) to (iii) based on the following code : OUTSIDE DELHI 2006 class furniture { char Type; char Model[10]; public: furniture(); void Read_fur_details(); void Disp_fur_details(); };

7 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];

8 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

9 (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)

10 (d) Answer the questions (i) to (iv) based on the following code : DELHI 20074 class Teacher { char TNo[5], TName[20], DeptflO]; int Workload; protected: float Salary; void AssignSal(float); public: Teacher( ) ; void TEntry( ) ; void TDisplay( ); };

11 (d) Answer the questions (i) to (iv) based on the following code : DELHI 20074 class Student { char Admno[10], SName[20], Stream[10]; protected: int Attendance, TotMarks; public: Student( ); void SEntry( ); void SDisplay( ); };

12 (d) Answer the questions (i) to (iv) based on the following code : DELHI 20074 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 ?

13 (d) Answer the questions (i) to (iv) based on the following code : DELHI 20074 (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.

14 (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( )

15 ( 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

16 (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 ( ); };

17 (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 ( ); };

18 (d) Answer the questions (i) to (iv) based on the following code : OUTSIDE DELHI 2007 4 class Institute : public Learner, public Trainer { char ICode[10], IName [20]; ( public: Institute ( ); void IEntry ( ); void IDisplay ( ); };

19 (d) Answer the questions (i) to (iv) based on the following code : OUTSIDE DELHI 2007 4 (i) Which type of Inheritance is depicted by the above example? (ii) Identify the member function(s) that cannot be called directly from the objects of class Institute from the following TEntry( ) LDisplay() IEntry()

20 (d) Answer the questions (i) to (iv) based on the following code : OUTSIDE DELHI 2007 4 (iii) Write name of all the member(s) accessible from member functions of class Institute. (iv) If class Institute was derived privately from class Learner and privately from class Trainer, then, name the member function(s) that could be accessed through Objects of class Institute.

21 (d) (i) Multiple Inheritance (1 Mark for correct answer) (ii) None OR All the above functions can be called. (1 Mark for correct answer) (iii) Data Members: ICode, IName, Attendance, Grade,Remuneration Member Functions: IEntry( ), IDisplay( ), LEntry(), LDisplay( ), AssignRem( ), TEntry( ), TDisplay( )

22 (1 Mark for correct members) Note: · Constructor functions Trainer(), Learner() and Institute() to be ignored. · No marks to be awarded for partially correct answers (iv) IEntry( ), IDisplay( ) (1 Mark for correct answer) NOTE: · Constructor function Institute() to be ignored. · No marks to be awarded for partially correct answers

23 (d) Answer the questions (i) to (iv) based on the following code: DELHI 20084 class Dolls { char DCode[5] ; protected: float Price; void CalcPrice(float); public: Dolls ( ); void DInput ( ) ; void DShow ( ) ; } ;

24 (d) Answer the questions (i) to (iv) based on the following code: DELHI 20084 class SoftDolls : public Dolls { char SDName[20] ; float Weight; public: SoftDolls ( ) ; void SDInput ( ) ; void SDShow ( ) ; } ;

25 (d) Answer the questions (i) to (iv) based on the following code: DELHI 20084 class ElectronicDolls: public Dolls { char EDName[20] ; char BatteryType[10]; int Batteries; public: ElectronicDolls ( ) ; void EDInput ( ) ; void EDShow ( ) ; } ;

26 (d) Answer the questions (i) to (iv) based on the following code: DELHI 20084 (i) Which type of Inheritance is shown in the above example? (ii) How many bytes will be required by an object of the class ElectronicDolls?. (iii) Write name of all the data members accessible from member functions of the class SoftDolls (iv) Write name of all the member functions accessible by an object of the class ElectronicDolls.

27 (i) Which type of Inheritance is shown in the above example? Ans: Hierarchical Inheritance OR Single Level Inheritance (1 mark for mentioning any of the above mentioned type of Inheritance) (ii) How many bytes will be required by an object of the class ElectronicDolls? Ans: 41 bytes (1 Mark for correct answer)

28 (iii) Write name of all the data members accessible from member functions of the class SoftDolls Ans: SDName, Weight, Price (1 Mark for correct answer) Note: No marks to be awarded for partially correct answer

29 (iv) Write name of all the member functions accessible by an object of the class ElectronicDolls. Ans: EDInput( ), EDShow( ), DInput( ), DShow( ) (1 Mark for Correct answer) Note: Constructor functions ElectronicDolls( ) & Dolls( ) to be Ignored. No marks to be awarded for partially correct answers

30 (d) Answer the questions (i) to (iv) based on the following code: OUTSIDE DELHI 20084 class Toys { char TCode [5] ; protected: float Price; void Assign (float); public: Toys( ) ; void TEntry ( ) ;, void TDisplay () ; } ;

31 (d) Answer the questions (i) to (iv) based on the following code: OUTSIDE DELHI 20084 class SoftTOYS: public Toys { char STName [ 20] ; float weight; public: SoftToys( ) ; void STEntry ( ) ; void STDisplay ( ); } ;

32 (d) Answer the questions (i) to (iv) based on the following code: OUTSIDE DELHI 20084 class ElectronicToys: public Toys { char ETName[20]; int No_of_Batteries; public: ElectronicToys( ) ; void ETEntry ( ) ; void ETDisplay ( ) ; } ;

33 (d) Answer the questions (i) to (iv) based on the following code: OUTSIDE DELHI 20084 (i) Which type of Inheritance is shown in the above example? (ii) How many bytes will be required by an object of the class SoftToys ? (iii) Write name of all the data members accessible from member functions of the class SoftToys. (iv) Write name of all the member functions, which are accessible from an object of the class ElectronicToys.

34 (i) Which type of inheritance is shown in the above example? Ans: Hierarchical Inheritance OR Single Level Inheritance (1 Mark to be given for mentioning any of the above mentioned type of inheritance) (ii) How many bytes will be required by an object of the class softToys? Ans: 33 (1 Mark for correct answer)

35 (iii) Write name of all the data member(s) accessible from member functions of class SoftToys. Ans: Data Members: Price, STName, Weight (1 Mark for all correct members) NOTE: No marks to be awarded for partially correct answers

36 (iv) Write name of all the member functions, which are accessible from an object of the class ElectronicToys. Ans: Member Functions: TEntry ( ), TDisplay ( ), ETEntry ( ), ETDisplay ( ) (1 Mark for correct answer) NOTE: Constructors Toys() & ElectronicToys(), it mentioned to be ignored. No marks to be awarded for partially correct answers

37 (d) Answer the questions (i) to (iv) based on the following: DELHI 2009 4 class FaceToFace { char CenterCode [10] ; public: void Input ( ) ; void Output ( ) ; } ; class Online { char website [50] ;

38 (d) Answer the questions (i) to (iv) based on the following: DELHI 2009 4 public: void SiteIn ( ) ; void SiteOut ( ) ; } ; class Training: public FaceToFace, private Online { long Tcode ; float charge; int period;

39 (d) Answer the questions (i) to (iv) based on the following: DELHI 2009 4 public: void Register ( ) ; void Show ( ) ; } ; (i) Which type of Inheritance is shown in the above example? (ii) Write names of all the member functions accessible from Show( ) function of class Training.

40 (d) Answer the questions (i) to (iv) based on the following: DELHI 2009 4 (iii) Write name of all the members accessible through an object of class Training. (iv) Is the function Output( ) accessible inside the function SiteOut( ) ? Justify your answer.

41 (i)Which type of Inheritance is shown in the above example? Ans Multiple Inheritance (1 Mark for mentioning correct inheritance type)

42 ii) Write names of all the member functions accessible from Show( ) function of class Training. Ans Register( ) Siteln( ). SiteOut( ). Input( ), Output( ) (1 Mark for correct answer) Note: No marks to be awarded for any other alternative answer

43 iii) Write name of all the members accessible through an object of class Training. Ans Register( ), Show( ), Input( ), Output( ) (1 Mark for correct answer) Note: No marks to be awarded for any other alternative answer

44 iv) Is the function Output( ) accessible inside the function SiteOut( )? Justify your answer. Ans No, function Output( ) is not accessible inside the function SiteOut( ), because Output( ) is a member of class FaceToFace and SiteOut( ) is a member of class Online. and the classes FaceToFace and Online are two independent classes. ( ½ Mark for mentioning NOT ACCESSIBLE correctly)

45 ( ½ Mark for correct justification) OR (1 Mark if YES is supported with valid justification that the function InRegular( ) is accessible inside the function InDistance( ) ONLY for an object of the derived class OR in context of Inheritance) NOTE: No mark to be awarded if only YES is written without any justification.

46 (d) Answer the questions (i) to (iv)based on the following: OUTSIDE DELHI 2009 4 class Regular { char SchoolCode[10]; public: void InRegular( ); void OutRegular( ); } ; class Distance { char StudyCentreCode [5] ; void InDistance( );

47 (d) Answer the questions (i) to (iv)based on the following: OUTSIDE DELHI 2009 4 public: void OutDistance ( ); } ; class Course: public Regular, private Distance { char Code [5] ; float Fees; int Duration; public: void InCourse( ); void OutCourse( ); } ;

48 (d) Answer the questions (i) to (iv)based on the following: OUTSIDE DELHI 2009 4 (i) Which type of Inheritance is shown in the above example? (ii) Write names of all the member functions accessible from OutCourse function of class Course. (iii) Write name of all the members accessible througb an object of class Course. (iv) Is the function InRegular( ) accessible inside the function InDistance( )? Justify your answer.

49 (i)Which type of Inheritance is shown in the above example? Ans Multiple Inheritance (1 Mark for mentioning correct type of inheritance)

50 (ii) Write names of all the member functions accessible from OutCourse function of class Course. Ans InCourse( ), InDistance( ), OutDistance( ), InRegular( ), OutRegular( ) (1 Mark for correct answer) Note: No marks to be awarded for any other alternative answer

51 (iii) Write name of all the.:members accessible througb an object of class Course. Ans InCourse( ), OutCourse( ), InRegular( ), OutRegular( ) (1 Mark for correct answer) Note: No marks to be awarded for any other alternative answer

52 (iv) Is the function InRegular( ) accessible inside the function InDistance( )? Justify your answer. Ans No, function InRegular( ) is not accessible inside the function InDistance( ), because InRegular( ) is a member of class Regular and InDistance( ) is a member of class Distance, and the classes Regular and Distance are two independent classes.

53 (½ Mark for mentioning NOT ACCESSIBLE correctly) (½ Mark for correct justification) OR (1 Mark if YES is supported with valid justification that the function InRegular( ) is accessible inside the function InDistance(} ONL Y for an object of the derived class OR in context of Inheritance} NOTE: No mark to be awarded if only YES is written without any justification.

54 (d) Answer the questions (i) to (iv) based on the following: DELHI 20104 class Chairperson { long CID; //Chairperson Identification Number char CName[20]; protected: char Description [40]; void Allocate(); public: Chairperson(); void Assign();

55 (d) Answer the questions (i) to (iv) based on the following: DELHI 20104 void Show(); }; class Director { int DID; //Director ID char Dname[20]; protected: char Profile[30]; public: Director();

56 (d) Answer the questions (i) to (iv) based on the following: DELHI 20104 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(); };

57 (d) Answer the questions (i) to (iv) based on the following: DELHI 20104 void Input(); void output(); }; class Company: private Chairperson, public Director { int CID; //Company ID char City[20], Country[20];

58 (d) Answer the questions (i) to (iv) based on the following: DELHI 20104 public: Company(); void Enter(); void Display(); }; (i) Which type of inheritance out of the following is specifically is illustrated in the above C++ code?

59 (a) Single Level Inheritance (b) Multi Level Inheritance (c) Multiple Inheritance (ii) Write the names of data members, which are accessible by objects of class type Company. (iii) Write the names of all member functions, which are accessible by objects of class type Company. (iv) Write the names of all members, which are accessible from member functions of class Director.

60 (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. (c) Multiple Inheritance (1 Mark for writing correct inheritance type)

61 (ii) Write the names of data members, which are accessible by objects of class type Company. Ans None (1 Mark for writing None or No data members)

62 (iii) Write the names of all member functions, which are accessible by objects of class type Company. Ans. Enter(), Display(), Input(), output() (1 Mark for writing correct member functions) Note: Both output() or Output() are acceptable as correct answer since differentiation between small and capital O is very difficult. No marks to be awarded for any other alternative answer Ignore mention of Constructor(s)

63 (iv) Write the names of all members, which are accessible from member functions of class Director. Ans. Input(), output(), Profile, Dname, DID (1 Mark for writing correct members) Note: Both output() or Output() are acceptable as correct answer since differentiation between small and capital O is very difficult. No marks to be awarded for any other alternative answer Ignore mention of Constructor(s)

64 (d) Answer the questions (i) to (iv) based on the following: OUTSIDE DELHI 20104 class Director { long DID; //Director Identification Number char Name[20]; protected: char Description[40]; void Allocate(); public: Director(); void Assign(); void Show(); };

65 (d) Answer the questions (i) to (iv) based on the following: OUTSIDE DELHI 2010 4 class ShowRoom:private Factory { int SID; //Showroom ID char City[20]; public: ShowRoom(); void Enter(); void Display(); };

66 (d) Answer the questions (i) to (iv) based on the following: OUTSIDE DELHI 2010 4 (i) Which type of inheritance out of the following is illustrated in the above C++ code? (a) Single Level Inheritance (b) Multi Level Inheritance (c) Multiple Inheritance (ii) Write the names of data members, which are accessible by objects of class type ShowRoom.

67 (d) Answer the questions (i) to (iv) based on the following: OUTSIDE DELHI 2010 4 (iii) Write the names of all member functions which are accessible by objects of class type ShowRoom. (iv) Write the names of all members, which are accessible from member functions of class Factory.

68 (i) Which type of inheritance out of the following is illustrated in the above C++ code? (a) Single Level Inheritance (b) Multi Level Inheritance (c) Multiple Inheritance Ans. (b) Multilevel Inheritance (1 Mark for mentioning correct option)

69 (ii) Write the names of data members, which are accessible by objects of class type ShowRoom. Ans. None (1 Mark for correct answer) Note: No marks to be awarded for any partial/alternative answer

70 (iii) Write the names of all member functions which are accessible by objects of class type ShowRoom. Ans. Enter(), Display() (1 Mark for correct answer) Note: No marks to be awarded for any partial/alternative answer Ignore mention of Constructor(s)

71 (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)

72 (d) Answer the questions (i) to (iv) based on the following: DELHI 20114 class Student { int Rno; char Name [20] ; float Marks; protected: void Result( ) ; public: Student( ) ; void Register( ); void Display( ) ; } ;

73 (d) Answer the questions (i) to (iv) based on the following: DELHI 20114 class Faculty { long FCode; char FName[20]; protected: float Pay; public : Faculty ( ) ; void Enter ( ) ; void Show ( ) ; } ;

74 (d) Answer the questions (i) to (iv) based on the following: DELHI 20114 class Course : public Student, private Faculty { long CCode [10]; char CourseName [50] ; char StartDate[8], EndDate[8] ; public : Course ( ) ; void Commence ( ) ; void CDetail ( ) ; } ;

75 (d) Answer the questions (i) to (iv) based on the following: DELHI 20114 (i) Which type of inheritance is illustrated in the above C++ code? (ii) Write the names of the all data members, which is/are accessible from member function Commence of class Course. (iii) Write the names of member functions, which are accessible from objects of class Course. (iv) Write the name of all the members, which are accessible from objects of class Faculty.

76 (i) Which type of inheritance is illustrated in the above C++ code? Ans Multiple Inheritance (1 Mark for correct answer) (ii) Write the names of the all data members, which is/are accessible from member function Commence of class Course. Ans CCode, CourseName, StartDate, EndDate, Pay (1 Mark for correct answer) Note: No marks to be awarded for any other alternative answer

77 (iii) Write the names of member functions, which are accessible from objects of class Course. Ans Commence( ), CDetail( ), Register( ), Display( ) (1 Mark for correct answer) Note: No marks to be awarded for any other alternative answer Constructor functions to be ignored

78 (iv) Write the name of all the members, which are accessible from objects of class Faculty. Ans Enter( ), Show( ) (1 Mark for correct answer) Note: No marks to be awarded for any other alternative answer Constructor functions to be iqnored

79 (d) Answer the questions (i) to (iv) based on the following: OUTSIDE DELHI 20114 class Student { int Rollno: char SName[20]; float Marksl; protected: void Result ( ) ; public: Student ( ) ; void Enroll ( ) ;void Display ( ) ; } ;

80 (d) Answer the questions (i) to (iv) based on the following: OUTSIDE DELHI 20114 class Teacher { long TCode; char TName [20]; protected: float Salary; public: Teacher ( ); void Enter ( ) ; void Show ( ) ; } ;

81 (d) Answer the questions (i) to (iv) based on the following: OUTSIDE DELHI 20114 class Course: public Student, private Teacher { long CCode [10]; char CourseName [50]; char StartDate [8], EndDate [8]; public: Course ( ) ; void Commence ( ); void CDetail ( ) ; } ;

82 (d) Answer the questions (i) to (iv) based on the following: OUTSIDE DELHI 20114 (i) Write the names of member functions, which are accessible from objects of class Course. (ii) Write the names of all the data members, which is/are accessible from member function Commence of class Course. (iii) Write the names of all the-members, which are accessible from objects of class Teacher. (iv) Which type of Inheritance is illustrated in the above C++ code?

83 (i) Write the names of member functions, which are accessible from objects of class Course Ans Commence( ) CDetail( ) Enroll( ) Display( ) (1 Mark for correct answer) Note: No marks to be awarded for a partially correct answer Constructor functions to be ignored

84 ii) Write the names of all the data members, which is/are accessible from member function Commence of class Course Ans CCode CourseName StartDate EndDate Salary (1 Mark for correct answer) Note: No marks to be awarded for a partially correct answer

85 iii) Write the names of all the-members, which are accessible from objects of class Teacher. Ans Enter( ), Show( ) (1 Mark for correct answer) Note: No marks to be awarded for a partially correct answer Constructor functions to be ignored iv) Which type of Inheritance is illustrated in the above C++ code? Ans Multiple Inheritance (1 Mark for correct answer) Note: No marks to be awarded for a partially correct answer

86 (d) Answer the questions (i) to (iv) based on the following: SAMPLE PAPER 2010 SET I 4 class PUBLISHER { char Pub[12]; double Turnover; protected: void Register(); public: PUBLISHER(); void Enter(); void Display(); };

87 (d) Answer the questions (i) to (iv) based on the following: SAMPLE PAPER 2010 SET I 4 class BRANCH { char CITY[20]; protected: float Employees; public: BRANCH(); void Haveit(); void Giveit(); };

88 (d) Answer the questions (i) to (iv) based on the following: SAMPLE PAPER 2010 SET I 4 class AUTHOR : private BRANCH, public PUBLISHER { int Acode; char Aname[20]; float Amount; public: AUTHOR(); void Start(); void Show(); };

89 (d) Answer the questions (i) to (iv) based on the following: SAMPLE PAPER 2010 SET I 4 (i) Write the names of data members, which are accessible from objects belonging to class AUTHOR. (ii) Write the names of all the member functions which are accessible from objects belonging to class BRANCH. (iii) Write the names of all the members which are accessible from member functions of class AUTHOR. (iv) How many bytes will be required by an object belonging to class AUTHOR?

90 (d) (i)None of data members are accessible from objects belonging to class AUTHOR. (1 Mark for correct answer) (ii) Haveit(), Giveit() (1 Mark for correct answer)

91 (iii) Data members: Employees, Acode, Aname, Amount Member function: Register(), Enter(), Display(), Haveit(), Giveit(), Start(), Show(), (1 Mark for correct answer) (iv) 70 (1 Mark for correct answer)

92 SAMPLE PAPER 2012 SET I

93

94

95

96

97 SAMPLE PAPER 2012 SET II

98

99

100

101 THANK YOU


Download ppt "XII CBSE Previous Year Question Paper QUESTION NO 2 (d) 4 Marks."

Similar presentations


Ads by Google