seth anand ram jaipuria school vasundhra , … · chemistry 1) select a relevant topic for the...

51
SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , GHAZIABAD SESSION 2017-18 CLASS-XII HOLIDAY HOMEWORK ENGLISH 1) Complete the given worksheet on the topics : a)The Last Lesson b) The Lost Spring c) Deep Water d) Elementary School Classroom in the Slum e) Silas Marner 2) Read the news paper every day and prepare notes of any three articles of your choice. MATHS 1) Prepare the chapters 1. Continuity and differentiability 2.Applications of derivatives for Unit Test – 2 and Class tests. 2) Attempt the assigned worksheet on Applications of derivatives. PHYSICS 1) Select a suitable topic for the Investigatory project and working model from the syllabus, collect information using various sources and compile it in a soft copy. 2) Complete the practical record and also write down five activities on A4 sheets in a separate file. ( two from each section). 3) Complete the worksheets of chapter 3 to 5 . CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a soft copy 2) Complete the assigned worksheets. (Unit- XII & XIV) 3) Make notes of the chapter “Polymers” by covering all the NCERT exercise questions. 4) Attempt All NCERT exercise questions of Amines(UNIT-XIII) and UNIT-1 in chemistry register. 5) Complete the practical record till the test of Carbohydrates, Fats and Proteins in the given food sample. 6) Prepare Unit–I and XIII, XIV & XV for UNIT TEST-2. BIOLOGY 1) Select a suitable topic for the Investigatory project, collect relevant information using various sources like internet, books, and science magazines and published articles. Compile the information collected in form of a file. 2) Complete the assigned worksheet.

Upload: others

Post on 27-Oct-2019

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

SETH ANAND RAM JAIPURIA SCHOOLVASUNDHRA , GHAZIABAD

SESSION 2017-18

CLASS-XII

HOLIDAY HOMEWORK

ENGLISH1) Complete the given worksheet on the topics :

a)The Last Lessonb) The Lost Springc) Deep Waterd) Elementary School Classroom in the Slume) Silas Marner

2) Read the news paper every day and prepare notes of any three articles of your choice.

MATHS 1) Prepare the chapters 1. Continuity and differentiability 2.Applications of derivatives

for Unit Test – 2 and Class tests.2) Attempt the assigned worksheet on Applications of derivatives.

PHYSICS1) Select a suitable topic for the Investigatory project and working model from the

syllabus, collect information using various sources and compile it in a soft copy. 2) Complete the practical record and also write down five activities on A4 sheets in a

separate file. ( two from each section).3) Complete the worksheets of chapter 3 to 5 .

CHEMISTRY

1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a soft copy

2) Complete the assigned worksheets. (Unit- XII & XIV)3) Make notes of the chapter “Polymers” by covering all the NCERT exercise questions.4) Attempt All NCERT exercise questions of Amines(UNIT-XIII) and UNIT-1 in

chemistry register.5) Complete the practical record till the test of Carbohydrates, Fats and Proteins in the

given food sample.6) Prepare Unit–I and XIII, XIV & XV for UNIT TEST-2.

BIOLOGY

1) Select a suitable topic for the Investigatory project, collect relevant information usingvarious sources like internet, books, and science magazines and published articles. Compile the information collected in form of a file.

2) Complete the assigned worksheet.

Page 2: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

BUSINESS STUDIES1) Complete the assignments given on the syllabus covered ( Chapter 1,2,3 – Self

Evaluation Test)2) Revise for the UNIT Test II( Chapter1,2,3). 3) Complete the Project on Principles of management as per the CBSE guidelines.

ACCOUNTANCY1) Redo the chapters covered so far for the UNIT-TEST II to be held after the holidays.

Also complete the questions given in Scanner.( Chapter 1,3 ,4, 5 )2) Project as per CBSE on Analysis of Financial Statements

ECONOMICS1) Complete the project as instructed in class.2) Complete the given worksheet.

Topics:a) PPCb) Consumer Equilibriumc) Theory of demandd) Production Functione) National Income Accounting

POLITICAL SCIENCE

1) Revise the given syllabus for UNIT TEST-2.(Chapters 4,5,6)2) Complete worksheets of Chapter 5,6,7,8.3) Prepare a report in 300 words on the growing international tensions and changing

power politics in the world since 2016.

HISTORY1) Revise the given syllabus for UNIT TEST-2.2) Complete the research work for the project (discussed in class).

COMPUTER SCIENCERevise the chapters covered so far for the UNIT-TEST II to be held after the holidays. Also complete the questions given in given in worksheet and also in question bank.

ENTREPRENEURSHIP Prepare a questionnaire and conduct sample survey in your locality with the objective to launch a new product or existing product with some additional benefits, of your own.

FINE ARTSMake:1) 3-Still life Composition (pencil shading) A-2 size2) 3-Sketches of daily life(picture Composition) A-2 size3) 2-Still life Composition (water colour) A-2 size

Page 3: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

PSYCHOLOGY1) Case Study about psychological disorders and intellectual disability2) Complete the given worksheet from chapter -3

PHYSICAL EUCATION1) Make a model on any one of the game.2) Complete your practical file

GENERAL STUDIES Choose any suitable topic and prepare a project Some suggested topics are :-1) The changing trends in Secondary Education2) Financial Inclusion3) Relationship of India with its neighboring countries.4) Most lucrative careers of youth today.GUIDELINES: ( Word limit-1000 to 2000 words, should be creative and original, to be made on ruled sheets, all the work should be handwritten, the written matter should not be copied from the net, only the pictures can be downloaded. It should be properly filed with a cover page containing the name of the student, class and section,roll no and name of the project.)

Page 4: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

HOLIDAY HOME WORK 2017- 2018

SUBJECT - ENGLISH

Class - XII

My Mother at Sixty-Six:

1. How does the poem bring out the irony about human relationship?2. What mental aspect of the poet is reflected in the concluding lines of the

poem?3. Discuss that the poet captivates the complex subtleties of human

relationship in the poem ‘My Mother at Sixty-Six’?4. With fear and ache inside her heart and words of assurance on lips and

smile on the face, the poet presents two opposite and contrasting experiences. Elucidate.

An Elementary School Classroom in a Slum:

1. What is the theme of the poem?2. In this poem, without being didactic, Spender interprets the poverty

stricken yet onward struggling men. Justify.3. How does the poet begin the poem with all despair and end with hope?4. What message does the poem give through the twin worlds of pessimism

and optimism as created by the poet in sketching the condition of the lives of the slum children?

The Last Lesson:

Short Answer Questions:

1. What does M.Hamel mean when he says “We all have a great deal to reproach ourselves with”?

2. Give the essence of ‘The Last Lesson’.3. Hamel while addressing Franz says about the fate of Alsace: “Ah, that is

the great trouble with Alsace.”. What fate of Alsace does he refer to?4. There flows an undercurrent of sadness and helplessness in the story.

What is it?

Long Answer Questions:

1. ‘The Last Lesson’ conveys the message about the tragedies of what. Discuss.

Page 5: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

2. ‘A teacher is a friend, a philosopher and a guide for his pupils.’ Do you think M.Hamel fits into this image of a teacher? Discuus.

3. Each language has its own beauty. People feel proud and elated while speaking their own language. Nobody has a right to take away the right tostudy or speak one’s own language. Right an article on the problems of linguistic minorities.

4. ‘All men are created equal, its only men who place themselves above equality.’ How far do you agree with the given quote referring to the orders that had come from Berlin regarding German Language to be taught in the schools of Alsace and Lorraine.

Lost Spring:

Short Answer Questions:

1. Why has Saheb left his home town? Does he remember it? Why/Why not?

2. Reading ‘Lost Spring’ leaves a bad taste in the mouth and a trial of helplessness caused by the pitiable condition of these people. Elaborate.

3. What is pitiable about Savita, a young girl bangle maker and the elderly woman sitting by her side?

4. ‘Why do you do this?’ Who ask this question and why? What is the reply that the speaker gets?

Long Answer Questions:

1. What could be some of the reasons for migration of people from villages to cities?

2. “Being born into the cast of bangle makers has become both a curse and adestiny”. Discuss giving examples from the text.

3. The erudite scholars opine that success in any field requires perseverance,patience, equanimity and practice. Discuss the dictum keeping in mind the expression-‘I will be a motor mechanic…I will learn to drive a car.’

Deep Water:

Short Answer Questions:

1. But the jump made no difference. Describe how the author felt at that time.

2. What did Douglas mean by saying, “All we have to fear is fear itself”?3. What physical complexes did Douglas suffer from?

Page 6: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

Long Answer Questions:

1. Discuss the personality traits of William Douglas as revealed from his auto biographical account?

2. ‘Deep Water’ is a saga of courage and perseverance. It highlights the needto overcome fear. What qualities according to you are needed to battle obstacles?

3. “All we have to fear is fear itself.” William Douglas had developed a phobia of water and he realised that fears are very difficult to overcome, unless they are tackled. Write an article on the topic ‘Conquering Fear is the beginning of Wisdon’.

Silas Marner (Novel):

1. What light is thrown on the life of villagers in the 19th century by the novelist, George Eliot?

2. What assessment do you make of William Dane’s character?3. Why was Silas forced to Lantern Yard?4. Write a short character sketch of Squire Cass.5. How is Silas regarded by the people of Raveloe? Is his own behaviour

responsible for that?6. What change comes in the attitude of villagers towards Silas after he

loses his treasure?7. How did Molly meet her tragic end?8. What transformation took place surrounding Silas after the coming of

Eppie in his life?

Page 7: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

CLASS XIIHOLIDAYS HOMEWORKCOMPUTER SCIENCE

Questions based on constructor & destructor 1. Answer the questions (i) and (ii) after going through the following program: #include <iostream.h>#include<string.h>class bazaar{ char Type[20] ;char product [20];int qty ;float price ;bazaar() //function 1{strcpy (type , .Electronic.) ;strcpy (product , .calculator.);qty=10;price=225;}public :void Disp() //function 2{cout<< type <<.-.<<product<<.:. <<qty<< .@. << price << endl ;}};void main (){Bazaar B ; //statement 1B. disp() ; //statement 2}(i)Will statement 1 initialize all the data members for object B with the values given in thefunction 1 ? Justify your answer suggesting the correction(s) to be made in the above code.(ii) What shall be the possible output when the program gets executed? (Assuming, if required _ the suggested correction(s) are made in the program).

2. Define a class Tour in C++ with the description given below Private Members:TCode of type stringNo of Adults of type integerNo of Kids of type integerKilometers of type integerPublic Members:A constructor to assign initial values as follows:TCode with the word .NULL.No of Adults as 0No of Kids as 0Kilometers as 0TotalFare as 0A function AssignFare() which calculates and assigns the value of the data member Totalfare as followsFor each AdultFare (Rs) For Kilometers500 >=1000300 <1000 & >=500200 <500For each Kid the above Fare will be 50% of the Fare mentioned in the above table

Page 8: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

For Example:If Kilometers is 850, Noofadults =2 and NoofKids =3Then TotalFare should be calculated asNumof Adults *300+ NoofKids *150i.e., 2*300+ 3 *150 =1050A function EnterTour() to input the values of the data members TCode, NoofAdults, NoofKids and Kilometers ; and invoke the AssignFare() function.A function ShowTour() which displays the content of all the data members for a Tour.

3. Answer the following questions (i) and (ii) after going through the following class. class Interview{int Month;public:interview(int y) {Month=y;} //constructor 1interview(Interview&t); //constructor 2};

(i) Create an object, such that it invokes Constructor 1.(ii) Write complete definition for Constructer 2.

4. Answer the following questions (i) and (ii) after going through the following class.class Test{char Paper[20];int Markspublic:Test() //Function 1{strcpy(Paper,.Computer.);Marks=0;} //Function 2Test(char P[]){strcpy(Paper,P);Marks=0;} //Function 3Test(int M){strcpy(Paper,.Computer.);Marks=M;}Test(char P[],int M) //Function 4{strcpy(Paper,P);Marks=M;}Test(Test &T); //Function 5~Test() //Function 6{ cout<<”\n over”;

}};

(i) Which feature Object Oriented Programming is demonstrated using Function 1, Function 2, Function 3 and Function 4 in the above class text?

(ii) Write statements in C++ that would execute Function 2 and Function 4 of class Text.

(iii) Write statements in C++ that would execute Function 1 and Function 3 of class Text.

(iv) Complete the definition of function 5

Page 9: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

(v) When function 6 will be executed.

INHERITANCE1. Consider the following declarations and answer the questions given below:#include <iostream.h>

class book{char title[20];char author[20];int noof pages;public:

void read();void show();};

class textbook: private textbook{int noofchapters, noofassignments;protected:int standard;void readtextbook();void showtextbook();};class physicsbook: public textbook{char topic[20]; public:void readphysicsbook();void showphysicsbook();};

(i) Name the members, which can be accessed from the member functions of class physicsbook.

(ii) Name the members, which can be accessed by an object of Class textbook.(iii) Name the members, which can be accessed by an object of Class physicsbook.(iv) What will be the size of an object (in bytes) of class physicsbook.

2.Answer the questions (i) to (iv) based on the following:

i) In case of the class father, what is the base class of father and what is the derived class offather?(ii) Write the data member(s) that can be accessed from function dispdata().(iii) Write the member function(s), which can be accessed by an object of mother class.(iv) Is the member function outputdata() accessible to the objects of father c

3.Answer the questions (i) to (iv) based on the following:

Page 10: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

(i) What type of inheritance is depicted by the above example?(ii) Write the member functions, which can be called by the object of class client.(iii) What is the size in bytes of the object of class doctor and client respectively?(iv)Write the data members, which can be used by the member functions of the class doctor

4.Answer the questions (i) to (iv) based on the following class Student{ int Rollno;char SName[20];float Marks;protected:void Result( );public:Student( );void Enroll ( );void Display ( );};class Teacher{ long TCode;char TName [ 20];protected :float Salary;public :Teacher( );void Enter ( );void Show ( );};class Course : public Student, private Teacher{ long CCode[10];114char CourseName[50];char StartDate [8], EndDate[8];public:Course( );void Commence( );void CDetail( );};(i) Write the names of member functions, which are accessible from objects of classCourse(ii) Write the names of all data members, which is/are accessible from member functionCommence of class Course(iii) Write the names of all the members, which are accessible from objects of classteacher.

(iv) Which type of inheritance is illustrated in the above C++ code?

Page 11: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

CLASS and OBJECT

1. The members of a class, by default, areA. public B. protectedC. private D. mandatory to specify

2. Which of the following statements are true in c++?A. Classes can not have data as public members.B. Structures can not have functions as members.C. Class members are private by default.D. None of these.

3. Member functions, when defined within the class specification:A. are always inline.B. are not inline.C. are inline by default, unless they are too big or too complicated.D. are not inline by default.

4. Which of the following concept of oops allows compiler to insert arguments in a function call if it is not specified?

A. Call by valueB. Call by referenceC. Default argumentsD. Call by pointer

5.Which of the following term is used for a function declared inside a class?

A. Member Variable

B. Member function

C. Class function

D. Classic function

6.Which of the following is an abstract data type?

A. int B. Double

C. string D. Class7. Which of the following is correct about class and structure?

A. class can have member functions while structure cannot.

B. class data members are public by default while that of structure are private.

C. Pointer to structure or classes cannot be declared.

D. class data members are private by default while that of structure are public by default.

8. Which of the following two entities (reading from Left to Right) can be connected by the dot operator?

A. A class member and a class object.

B. A class object and a class.

C. A class and a member of that class.

D. A class object and a member of that class.

Page 12: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

9 Which of the following keywords is used to control access to a class member?

A. Default B. Break

C. protected D. Asm

10. Which of the following can access private data members or member functions of a class?A. Any function in the program.B. All global functions in the program.C. Any member function of that class.D. Only public member functions of that class.

11.Which of the following also known as an instance of a class?

A. Friend Functions B. Object

C. Member Function d. Member Variable

12.

Scope resolution operator is represented by

A. ~ B. :: c. : d. ;

13. Constructor is executed when _____.

A. an object is created

B. an object is used

C. a class is declared

D. an object goes out of scope.

14. Use of __________ protects data from inadvertent modifications.A. private access specifierB. class protection operator, @C. none of theseD. public access specifier

15.Which of the following statements is correct?

A. Data items in a class must be private.

B. Both data and functions can be either private or public.

C. Member functions of a class must be private.

D. Constructor of a class cannot be private.

16.Which of the following is the only technical difference between structures and classes in C++?

A. Member function and data are by default protected in structures but private in classes.

B. Member function and data are by default private in structures but public in classes.

C. Member function and data are by default public in structures but private in classes.

Page 13: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

D. Member function and data are by default public in structures but protected in classes.

17. Which of the following is user defined data type?

A. int

B. Private

C. Class

D. A & B Both18. The Object is not declared for which class?

A. Parent B. Base

C. Abstract D. Derived

19. Data member is also called?

A. Attribute

B. Method

C. Class

D. Object20. A Class can have how many destructors?

A. 1 B. 2 C. 3 D. 4

21. State true of false.i) We cannot make the function inline by defining a function outside the class.ii) A member function can be called by using its name inside another member function of the same class, this is known as nesting of member function.A) True, TrueB) True, FalseC) False, TrueD) False, False

22. …………… is a way to bind the data and its associated functions together which allows the data and functions to be hidden.A) StructureB) ClassC) EnumD) Both A and B

23. What happens when we try to compile the class definition in following code snippet?#include<iostream.h>

void main(){

class Birds {};class Peacock : protected Birds {};}

A. It will not compile because class body of Eagle is not defined.

B. It will not compile because a class cannot be protectedly inherited from other class.

Page 14: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

C. It will compile successfully.

D. It will not compile because class body of Birds is not defined.

24. Which of the following can access private data members or member functions of a class?

A. Any function in the program.

B. All global functions in the program.

C. Any member function of that class.

D. Only public member functions of that class.

25. Which of the following type of data member can be shared by all instances of its class?

A. Public

B. Inherited

C. protected

D.Private

26. How many specifiers are present in access specifiers in class?A. 1B. 2C. 3D. 4

27. Which is used to define the member of a class externally?

A. : B. :: C. # D. none of the above

28. What is the output of this program?#include <iostream.h>

classrect{int x, y;public:voidval(int, int);int area (){return(x * y);}};voidrect::val(int a, int b)

Page 15: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

{ x = a; y = b;}int main (){rectrect;rect.val(3, 4);cout<<"rect area: "<<rect.area();return0;}

A. rect area:12B. rect area: 12C. rect area:24D. rect area:42

29. Which of the following is a valid class declaration?A. class A { int x; }; B. class B { } C. public class A { } D. object A { int x; };

30. When struct is used instead of the keyword class means, what will happen in the program? A. access is public by default

B. access is private by defaultC. access is protected by defaultD. none of the mentioned

31. How to access the members through class object? A. scope resolution operator B. ternary operator C. direct member access operator (.) D. none of the mentioned

32. Which of these following members are not accessed by using direct member access operator(.)? A. public B. private C. protected D. Both b & c

33. What is the output of the following program?#include <iostream.h>class Box{public:double length;double breadth;double height;};void main(){ Box Box1;double volume; Box1.height=5; Box1.length=6; Box1.breadth=7.1; volume = Box1.height* Box1.length* Box1.breadth;cout<<"Volume of Box1 : "<< volume <<endl;}A. 210 B. 213 C. 215

Page 16: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

D. 217

34. What is the output of the program?#include <iostream.h>

classRect{int x, y;public:voidset_values(int,int);int area (){return(x * y);}};voidRect::set_values(int a, int b){ x = a; y = b;}int main (){Rect recta, rectb;recta.set_values(5, 6);rectb.set_values(7, 6);cout<<"recta area: "<<recta.area();cout<<"rectb area: "<<rectb.area();return0;}

A. recta area: 30 rectb area: 42B. recta area: 20 rectb area: 34C. recta area: 30 rectb area: 21D. none of the mentioned

35. How many objects can created of a class?A. 1B. 2C. 3D. as many as possible

36. Pick out the other definition of objects.A. member of the classB. associate of the classC. attribute of the classD. instance of the class

37. What is the output of this program?#include <iostream.h>class sample{private:intvar;public:void input(){

Page 17: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

cout<<var;}void output(){cout<<"Variable entered is ";cout<<var<<"\n";}};void main(){ sample object;object.var=5;object.input();object.output();

}A. Variable entered is 5B. runtime errorC. private member access by objectD. none of the mentioned

38. Which special character is used to mark the end of class? A. ; B. : C. # D. $

39. What is the output of this program?#include <iostream.h>

class number{inti;public:intgeti();voidputi(int j);};int number::geti(){returni;}void number::puti(int j){i= j;}void main(){ number s;s.puti(10);cout<<s.geti();}

A. 10B. 11C. 20D. 22

40. Which is true for this keyword

A. this.memberB. this->member

Page 18: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

C. this*.memberD. *this.member

Page 19: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

CONSTRUCTORS & DESTRUCTORS1. Which of the following is not a type of constructor?

A. Copy constructor

B. Friend constructor

C. Default constructor

D. Parameterized constructor

2. Which of the following statement is correct?A. A constructor is called at the time of declaration of an object.

B. A constructor is called at the time of use of an object.

C. A constructor is called at the time of declaration of a class.

D. A constructor is called at the time of use of a class.

3. Which of the following is correct about function overloading?A. The types of arguments are different.

B. The order of argument is different.

C. The number of argument is same.

D. Both A and B.4. Given a class named Book, which of the following is not a valid constructor?

A. Book ( ) { }

B. Book ( Book b) { }

C. Book ( Book &b) { }

D. Book (char* author, char* title) { }5. How many constructors can a class have?

A. 0

B. 1

C. 2

D. any number6. Which of the following is not the characteristic of constructor.

A. They should be declared in the public section.

B. They do not have return type.

C. They can not be inherited.

D. They can’t be of same name as that of a class.7. A copy constructor takes

A. no argument

B. one argument

C. two arguments

D. arbitrary no. of arguments8.

A constructor that accepts __________ parameters is called the default constructor.

A. one B. two

C. no D. five

Page 20: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

9.What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object with no-arguments?

A. Compile-time error.

B. Preprocessing error.

C. Runtime error.

D. Runtime exception.

10.Destructor has the same name as the constructor and it is preceded by ______ .

A. ! B. ?

C. ~ D. &

11.Constructors and destructors are called implicitly when the objects of the class is .....

A. Created and releases memory

B. inherit parent class

C. are constructed

D. are destroyed

12.Which constructor function is designed to copy objects of the same class type?

A. Create constructor

B. Object constructor

C. Dynamic constructor

D. Copy constructor

13.Which of the following statement is correct?

A. Constructor has the same name as that of the class.

B.Destructor has the same name as that of the class with a tilde symbol at the beginning.

C. Both A and B.

D. Destructor has the same name as the first member function of the class.

Page 21: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

14.Which of the following statement is incorrect?

A. Constructor is a member function of the class.

B. The compiler always provides a zero argument constructor.

C. It is necessary that a constructor in a class should always be public.

D. Both B and C.

15.When are the Global objects destroyed?

A. When the control comes out of the block in which they are being used.

B. When the program terminates.

C. When the control comes out of the function in which they are being used.

D. As soon as local objects die.

16.Copy constructor must receive its arguments by __________ .

A. either pass-by-value or pass-by-reference

B. only pass-by-value

C. only pass-by-reference

D. only pass by address

17. A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.

A. constructor B. destructor

C. function D. object

18.Which of the following gets called when an object goes out of scope?

A. constructor

B. destructor

C. main

D. virtual function

19.

Which of the following statement is correct?

Page 22: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

A. Destructor destroys only integer data members of the object.

B. Destructor destroys only float data members of the object.

C. Destructor destroys only pointer data members of the object.

D. Destructor destroys the complete object.

20.__________ is used to make a copy of one object to another object of the same class type.

A. constructor

B. copy constructor

C. destructor

D. default constructor

21.Constructors __________ to create objects in different ways.

A. cannot overloaded

B. can be overloaded

C. can be called

D. can be nested

22.Which of the following statement is correct?

A. A destructor has the same name as the class in which it is present.

B. A destructor has a different name than the class in which it is present.

C. A destructor always returns an integer.

D. A destructor can be overloaded.

23.Which of the following are NOT provided by the compiler by default?

A. Zero-argument Constructor

B. Destructor

C. Copy Constructor

D. A & B

24.It is a __________ error to pass arguments to a destructor.

Page 23: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

A. logical B. virtual

C. syntax D. linker

25.If the programmer does not explicitly provide a destructor, then which of the following creates an empty destructor?

A. Preprocessor

B. Compiler

C. Linker

D. main() function

26.A constructor having parameters with default values is known as ..........

A. default constructor

B. copy constructor

C. Constructor with default values.

D. None of these

27.How many default constructors per class are possible?

A. Only one

B. Two

C. Three

D. Unlimited

28.Which of the following statement is correct about destructors?

A. A destructor has void return type.

B. A destructor has integer return type.

C. A destructor has no return type.

D. A destructors return type is always same as that of main().

29.Which of the following statement is correct?

Page 24: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

A. A constructor has the same name as the class in which it is present.

B. A constructor has a different name than the class in which it is present.

C. A constructor always returns an integer.

D.A constructor cannot be overloaded.

30.Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class?

A. Preprocessor B. Linker

C. Loader D. Compiler

E.

31.A destructor takes __________ arguments.

A. one B. two

C. three D. no

32.Destructor calls are made in which order of the corresponding constructor calls?

A. Reverse order

B. Forward order

C. Depends on how the object is constructed

D. Depends on how many objects are constructed

33.Which of the following never requires any arguments?

A. Member function

B. Friend function

C. Default constructor

D. const function

34.A class's __________ is called when an object is destroyed.

Page 25: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

A. constructor

B. destructor

C. assignment function

D.copy constructor

35.Destructors __________ automatically when the program terminates with a call to function exit or function abort.

A. are called

B. are inherited

C. are not called

D. are created

36.Which of the following statement is correct?

A.A constructor of a derived class can access any public and protected member of the base class.

B. Constructor cannot be inherited but the derived class can call them.

C.A constructor of a derived class cannot access any public and protected memberof the base class.

D. Both A and B

37.Which of the following statements are correct?

A. Constructor is always called explicitly.

B.Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly.

C. Destructor is always called explicitly.

D.Constructor and destructor functions are not called at all as they are always inline.

38.How many times a constructor is called in the life-time of an object?

Page 26: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

A. Only once

B. Twice

C. Thrice

D. Depends on the way of creation of object

39.Which of the following statement is correct about constructors?

A. A constructor has a return type.

B. A constructor cannot contain a function call.

C. A constructor has no return type.

D. A constructor has a void return type.

40.Which of the following statement is correct whenever an object goes out of scope?

A. The default constructor of the object is called.

B. The parameterized destructor is called.

C. The default destructor of the object is called.

D. None of the above.

41. Answer the questions (i) and (ii) after going through the following program #include<iostream.h>#include<string.h>class Bazar{

char Type[20];char Product[20];int Qty;float Price;Bazar() //Function 1{

strcpy (Type,”Electronic”);strcpy (Product,”Calculator”);Qty = 10;Price=225;

}

public:void Disp( ) //Function 2{

cout<<Type<<”-“<<Product<<”:“<<Qty<<”@“<<Price<<endl;}

};void main( ){

Bazar B; //Statement 1B.Disp(); //Statement 2

Page 27: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

}

(i) Will Statement 1 initialize all the data members for object B with the values given in the Function 1? Justify your answer suggesting the correction(s) to be made in the above code.

A. YesB. No

(ii) What shall be the possible output when the program gets executed? (Assuming, if required – the suggested correction(s) are made in the program).

A. Electronic-Calculator:10@225

B. Electronic Calculator ::10@250

C. Electronic Calculator :10@250

D. Electronic-Calculator::10@22542. Answer the questions (i) and (ii) after going through the following class:

class Seminar{ int Time; public: Seminar() //Function 1 { Time=30;cout<<”Seminar starts now”<<end1; } void Lecture() //Function 2 { cout<<”Lectures in the seminar on”<<end1; } Seminar(int Duration)//Function 3 { Time=Duration;cout<<”Seminar starts now”<<end1; }

~Seminar() //Function 4 { cout<<”Vote of thanks”<<end1; }};

(i) In Object Oriented Programming, what is Function 4 referred as ?

A. Copy Constructor

B. Constructor

C. Destructor

D. Default Constructor

(ii) In Object Oriented Programming, when does Function 4 getinvoked/called?

A. When user calls it.

Page 28: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

B. It is invoked as soon as the scope of the object gets over.

C. It can’be invoked.

D. A & C

(iii) In Object Oriented Programming, which concept is illustrated byFunction 1 and Function 3 together? Write an example illustrating thecalls for these functions.

A. InheritanceB. EncapsulationC. Constructor Overloading (Polymorphism)D. Data hiding

(iv) What is the correct code to call Function 1?A. Seminar S1B. Seminar S1;C. S1;D. A & C

(v) What is the correct code to call Function 3?A. Seminar S2(90);B. Seminar S2;C. S2;D. B & C

43. In which case is it mandatory to provide a destructor in a class?A. Almost in every class

B. Class for which two or more than two objects will be created

C. Class for which copy constructor is defined

D. Class whose objects will be created dynamically44 Constructor Overloading implements ............... feature of OOPs

A. PolymorphismB. InheritanceC. AbstractionD. None

45 What happens when following statements are executes assuming Book is a classBook a,b;--------a=b;

A. Copy Constructor is called.B. Default ConstructorC. Assignment OperationD. None

Page 29: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

INHERITANCE1. The process of building new classes from existing one is called ______.

A. PolymorphismB. StructureC. InheritanceD. Cascading

2. Mechanism of deriving a class from another derived class is known as____

A. PolymorphismB. Single InheritanceC. Multilevel InheritanceD. Message Passing

3. If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C member function can access

A. Protected and public data only in C and BB. Protected and public data only in CC. Private data in A and BD. Protected data in A and B

4. The base class access specification determines how ___________ members in the base class may be accessed by derived classes.

A. PrivateB. PublicC. ProtectedD. All of the above

5. A base class may also be called a

A. Child classB. SubclassC. Derived classD. Parent class

6. Which of the statements are true ?I. Function overloading is done at compile time.II. Protected members are accessible to the member of derived class.III. A derived class inherits constructors and destructors.IV. A friend function can be called like a normal function.V. Nested class is a derived class.

A. I, II, IIIB. II, III, VC. III, IV, VD. I, II, IV

7. In multiple inheritance -

A. The base classes must have only default constructorsB. Cannot have virtual functions

Page 30: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

C. Cannot have virtual classesD. None of the above

8. When a sub class is inherited from only one super class .It is known as

A. Single inheritanceB. Multiple inheritanceC. Hierarchical inheritanceD. Multilevel inheritance

9. _________ members of a base class are never accessible to a derived class.

A. PrivateB. PublicC. ProtectedD. All of the above

10. What part of object-oriented technology defines superclass and subclass relationships?

A. Inheritance

B. Scalability

C. Encapsulation

D. Polymorphism

11. In a student grading system, objects from different classes communicate with each other. These

communications are known as _____.

A. Inheritance

B. Scalability

C. Encapsulation

D. Polymorphism

12. What common technique attempts to save time and energy by reducing redundant work in

object-oriented programming?

A. Reduce lines of programming

B. Reuse of code

C. Reduce size of systems being developed

D. Merging different systems together

13. Which of the following term is used for a function defined inside a class?

A. Member Variable

B. Member function

C. Class function

D. Classic function

14. Which of the following is the valid class declaration header for the derived class b with base class a and derived class c with base class b?

A. class b : public a { }; class c : public b{ };B. class d : class b1, class b2C. class a : public b { }; class b : public c{ };D. class d : b1, b2

E.

Page 31: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

15. Which of the statements is true in a protected derivation of a derived class from a base class?A. Private members of the base class become protected members of the derived classB. Protected members of the base class become public members of the derived classC. Public members of the base class become protected members of the derived classD. Protected derivation does not affect private and protected members of the derived

class.16. Which of the following is the valid class declaration header for the derived class d with base

classesb1 and b2?

A. class d : public b1, public b2B. class d : class b1, class b2C. class d : public b1, b2 D. class d : b1, b2

17. The major goal of inheritance in c++ is:A. To facilitate the conversion of data types.B. To help modular programming.C. To extend the capabilities of a class.D. To hide the details of base class.

18. Consider the following class definitions:class a{};class b: protected a{};What happens when we try to compile this class?

A. Will not compile because class body of a is not defined.B. Will not compile because class body of b is not defined.C. Will not compile because class a is not public inherited.D. Will compile successfully.

19. In access control in a protected derivation, visibility modes will change as follows:A. private, public and protected become protectedB. only public becomes protected.C. public and protected become protected.D. only private becomes protected.

20. Which allows you to create a derived class that inherits properties from more than one base class? A. Multilevel inheritance B. Multiple inheritance C. Hybrid Inheritance D. Hierarchical Inheritance

21. Which feature in OOP allows reusing code? A. Polymorphism B. Inheritance C. Encapsulation D. Data hiding

22. To hide a data member from the program, you must declare the data member in the _____ section of the class

A. concealed B. confidential C. hidden D. private

23. When you derive a class privately, a protected base class member becomes

Page 32: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

A. privateB. publicC. not inheritedD. protected

24. Irrespective of type of derivation__________members of a base class are never accessible in

derived class.

A. (b), (d) and (e)

B. private

C. none of these

D. protected

E. public25. A class inherited from an existing class is known as _____________.

A. derived classB. inheriteeC. child classD. A and C

26. When two or more classes serve as base class for a derived class, the situation is known as __________.

A. multiple inheritanceB. polymorphismC. encapsulationD. None of these

27.Which type of inheritance is depicted in the given example?class school : public student, private teacher

A. Multilevel InheritanceB. Multiple InheritanceC. Single Level InheritanceD. None of these

28. When derived class and base classes both contain constructors, the base constructor is executed first and then the constructor in the derived class is executed.

A. TrueB. FalseC. All of the aboveD. None of the above

29. How Many bytes will be required by an object of the class SHOP? class CUSTOMER{intCust_no;char Cust_Name[20];};class SALESMAN{intSalesman_no;char Salesman_Name[20];protected:float Salary;};class SHOP : private CUSTOMER, public SALESMAN{char Voucher_No[10];char Sales_Date[8];

Page 33: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

};A. 56 bytesB. 18 bytesC. 88 bytesD. 66 bytes

30. Which type of inheritance is shown in the following example?class olympics{int no_of_events; char country_name[25];};class outdoorgame : public olympics{char eventname[20];inteventcode;};class hockey : public outdoorgame{intno_of_players;char venue[25];};

A. Multilevel InheritanceB. Multiple InheritanceC. Single Level InheritanceD. None of these

31. consider the following class declaration and answer the question below :

class university {

intnoc;

protected;

char uname[25];

public:

university();

char state[25];

};

class college:public university{

int nod;

char cname[25];

public:

college();

};

class department:public college{

char dname[25];

intnof;

public:

department();

};

Which class’s constructor will be called first at the time of declaration of an object of

class department?

Page 34: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

A. universityB. departmentC. collegeD. No class constructor will be called

32. consider the following class declaration and answer the question below :

class university {

int noc;

protected;

char uname[25];

public:

university();

char state[25];

};

class college:public university{

int nod;

char cname[25];

public:

college();

};

class department:public college{

char dname[25];

intnof;

public:

department();

};

(i) How many bytes does an object belonging to class college, university and

department require respectively?A. 79, 52,106B. 52,106,79C. 106,79,52D. 79,54,106

(ii) Which data member will be accessible from the object of class department?

A. nocB. dnameC. nofD. state

33. What is the output of this program?#include <iostream.h>class A{public: A(int n ){

Page 35: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

cout<< n;}};class B:public A{public: B(int n, double d): A(n){cout<< d;}};class C:public B{public: C(int n, double d, charch): B(n, d){cout<<ch;}};int main(){ C c(5, 4.3, 'R');return0;}

A. 54.3R

B. R4.35

C. 4.3R5

D. None of the mentioned

34. What is the output of this program?#include <iostream.h>

classBaseClass{protected:inti;public:BaseClass(int x){i= x;} ~BaseClass(){}};classDerivedClass:publicBaseClass{int j;public:DerivedClass(int x, int y):BaseClass(y){ j = x;} ~DerivedClass()

Page 36: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

{}void show(){cout<<i<<" "<< j <<endl;}};int main(){DerivedClassob(3, 4);ob.show();return0;}

A. 3 4B. 4 3C. 4D. 3

35 What is the output of this program?#include <iostream.h>

class Base{public:int m; Base(int n=0): m(n){cout<<"Base"<<endl;}};class Derived:public Base{public:double d; Derived(double de =0.0): d(de){cout<<"Derived"<<endl;}};int main(){cout<<"Instantiating Base"<<endl; Base cBase;cout<<"Instantiating Derived"<<endl; Derived cDerived;return0;}

A. Instantiating Base

Base

Instantiating Derived

Base

Derived

Page 37: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

B. Instantiating Base

Instantiating Derived

Base

Derived

C. Instantiating Base

Base

Instantiating Derived

Base

D. None of the mentioned

36.

What is the output of this program?

#include <iostream.h>class Parent{public: Parent (void){cout<<"Parent()\n";} Parent (inti){cout<<"Parent("<<i<<")\n";}; Parent (void){cout<<"~Parent()\n";};};class Child1 :public Parent {};class Child2 :public Parent{public: Child2 (void){cout<<"Child2()\n";} Child2 (inti): Parent (i){cout<<"Child2("<<i<<")\n";} ~Child2 (void){cout<<"~Child2()\n";}};int main (void){ Child1 a; Child2 b; Child2 c(42);

Page 38: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

return0;}A. Parent()

Parent()

Child2()

Parent(42)

Child2(42)

~Child2()

~Parent()

~Child2()

~Parent()

~Parent()

B. Error C. runtime error D. None of the mentioned

Page 39: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

CHAPTER WISE QUSTIONSComputer Science: Class XII

(c++ REVISION TOUR, CLASSES&OBJECTS, CONSTRUCTOR&DESTRUCTOR and Inheritance)

Sh ort Answ er Typ e Q uestion s (2-Marks )

1. Define Macro with suitable example.2. Explain in brief the purpose of function prototype with the help of a suitable example.3. What is the difference between Global Variable and Local Variable?4. What is the difference between Object Oriented Programming and Procedural

Programming?5. What is the difference between Global Variable and Local Variable? Also, give a suitable

C++ code to illustrate both.6. Differentiate between ordinary function and member functions in C++. Explain with an

example.7. What is the difference between call by reference and call by value with respect to memory

allocation? Give a suitable example to illustrate using C++ code.8. What is the difference between actual and formal parameter ? Give a suitable example to

illustrate using a C++ code.9. Differentiate between a Logical Error and Syntax Error. Also give suitable examples of each

in C++.10. Find the correct identifiers out of the following, which can be used for naming variable,

constants or functions in a C++ program :While, for, Float, new, 2ndName, A%B, Amount2, _Counter

11. Out of the following, find those identifiers, which cannot be used for naming Variable,Constants or Functions in a C++ program :

_Cost, Price*Qty, float, Switch, Address One, Delete, Number12, do12. Find the correct identifiers out of the following, which can be used for naming Variable,

Constants or Functions in a C++ program :For, while, INT, NeW, delete, 1stName, Add+Subtract, name1

Page 40: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

Very Sh ort An sw er Typ e Qu estion s ( 1-Mark Based on Header Fil es)

1. Which C++ header file (s) will be included to run /execute the following C++ code?void main( ){ int Last =26.5698742658;cout<<setw(5)<<setprecision(9)<<Last; }

Ans: iostream.h, iomanip.h

2. Name the header files that shall be needed for successful compilation of the following C++code :

void main(){ char str[20],str[20];

gets(str); strcpy(str1,str); strrev(str);puts(str);puts(str1); }

3. Write the names of the header files to which the following belong:(i) strcmp() (ii) fabs()

4. Write the names of the header files to which the following belong:(i) frexp() (ii) isalnum()

Sh ort An sw er Typ e Question s ( 2-Mark s Erro r Find in g)

1. Rewrite the following program after removing any syntactical errors. Underline eachcorrection made.

#include<iostream.h>void main( ) int A[10]; A=[3,2,5,4,7,9,10]; for( p = 0; p<=6; p++){ if(A[p]%2=0) int S = S+A[p]; }cout<<S;}

Ans :- #include<iostream.h>void main( ){ int A[10] = {3,2,5,4,7,9,10};int S = 0,p;for(p = 0; p<=6; p++){ if(A[p]%2==0) S =S+A[p]; } cout<<S; }

2. Deepali has just started working as a programmer in STAR SOFTWARE company. Inthe company she has got her first assignment to be done using a C++ function to find thesmallest number out of a given set of numbers stored in a one-dimensional array. But she hascommitted some logical mistakes while writing the code and is not getting the desired result. Rewritethe correct code underlining the corrections done. Do not add any additional statements in thecorrected code

int find(int a[],int n){ int s=a[0];

for(int x=1;x<n;x++)if(a[x]>s) a[x]=s; return(s); }

3. Rewrite the following program after removing the syntactical errors (if any). Underline eachcorrection.

#include [iostream.h]class PAYITNOW{ int Charge;PUBLIC:

void Raise(){cin>>Charge;}void Show{cout<<Charge;}

Page 41: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

};void main(){PAYITNOW P;P.Raise(); Show();}

4. Rewrite the following program after removing the syntactical errors (if any). Underline eachcorrection.

#include <iostream.h>struct Pixels{ int Color,Style;}void ShowPoint(Pixels P){ cout<<P.Color,P.Style<<endl;}void main(){

Pixels Point1=(5,3); ShowPoint(Point1); Pixels Point2=Point1;Color.Point1+=2; ShowPoint(Point2);

}Short Answer Type Questions (2-Marks Finding Output)

2. Find the output of the following C++program:#include<iostream.h>void repch(char s[]){for (int i=0;s[i]!='\0';i++){if(((i%2)!=0) &&(s[i]!=s[i+1])){ s[i]='@'; cout<<"Hello";}else if (s[i]==s[i+1]){ s[i+1]='!'; i++;

1. Find output of the following program segment :#include<iostream.h>#include<ctype.h>void Mycode(char Msg[],char CH){ for(int cnt=0;Msg[cnt]!=‘\0’;cnt++){ if(Msg[cnt]>=‘B’&& Msg[cnt]<=‘G’)Msg[cnt]=tolower(Msg[cnt]); else if(Msg[cnt]==‘N’||Msg[cnt]==‘n’||Msg[cnt]==‘ ’)

Msg[cnt]=CH;else if(cnt%2==0)

Msg[cnt]=toupper(Msg[cnt]); elseMsg[cnt]=Msg[cnt–1]; } }

} } }void main() void main()

{ char MyText[]="Input Raw";{char str[]="SUCCESS";cout<<”Original String”<<str repch(str);

Mycode(MyText,‘@’);cout<<"NEW TEXT:"<<MyText<<endl;

}cout<<"Changed String"<<str;

}Ans: Original String SUCCESSChanged String S @C ! E S !

3. Find the output of the following program:

#include <iostream.h>#include <ctype.h>void Encrypt(char T[])

Page 42: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

{for (int i=0;T[i]!='\0';i+=2)

if (T[i]=='A' || T[i]=='E') T[i]='#';else if (islower(T[i])) T[i]=toupper(T[i]);else T[i]='@';

}void main(){char Text[]="SaVE EArtH";//The two words in the string Text//are separated by singlespace Encrypt(Text); cout<<Text<<endl;}

4. Find the output of the following program:#include <iostream.h>struct Game{char Magic[20];int Score;};void main(){

Game M={“Tiger”,500};char *Choice; Choice=M.Magic; Choice[4]=’P’; Choice[2]=’L’; M.Score+=50;cout<<M.Magic<<M.Score<<endl;Game N=M; N.Magic[0]=’A’;N.Magic[3]=’J’; N.Score-=120; cout<<N.Magic<<N.Score<<endl;

}

App li cation Based Qu estions ( 3 Mark s Find in g Ou tpu t)1. Find the output of the following :#include<iostream.h>void switchover(int A[ ],int N, int split){for(int K = 0; K<N; K++)if(K<split) A[K]+= K;elseA[K]*= K; }void display(int A[ ] ,int N){for(int K = 0; K<N; K++)(K%2== 0) ?cout<<A[K]<<"%" : cout<<A[K]<<endl;}void main( ){ int H[ ] = {30,40,50,20,10,5}; switchover(H,6,3); display(H,6); }Ans : 30%41

52%60

40%25

2. Find the output of the following program :#include<iostream.h>void in(int x,int y, int &z){ x+=y; y- -; z*=(x–y);}void out(int z,int y, int &x){ x*=y; y++; z/=(x+y);}void main(){ int a=20, b=30, c=10;

out(a,c,b); cout<<a<<"#"<<b<<"#"<<c<<"#"<<endl; in(b,c,a); cout<<a<<"@"<<b<<"@"<<c<<"@"<<endl; out(a,b,c); cout<<a<<"$"<<b<<"$"<<c<<"$"<<endl; }

3. Find the output of the following program:

#include <iostream.h>struct PLAY

Page 43: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

{ int Score, Bonus;};void Calculate(PLAY &P, int N=10){

P.Score++;P.Bonus+=N;}void main(){

PLAY PL={10,15}; Calculate(PL,5); cout<<PL.Score<<”:”<<PL.Bonus<<endl; Calculate(PL); cout<<PL.Score<<”:”<<PL.Bonus<<endl; Calculate(PL,15);cout<<PL.Score<<”:”<<PL.Bonus<<endl;

}

4. Find the output of the following program:#include <iostream.h>void Changethecontent(int Arr[], int Count){for (int C=1;C<Count;C++) Arr[C-1]+=Arr[C];}void main(){int A[]={3,4,5},B[]={10,20,30,40},C[]={900,1200}; Changethecontent(A,3);Changethecontent(B,4); Changethecontent(C,2);for (int L=0;L<3;L++) cout<<A[L]<<’#’;

cout<<endl;for (L=0;L<4;L++) cout<<B[L] <<’#’;

cout<<endl;for (L=0;L<2;L++) cout<<C[L] <<’#’;

}

5 Find the output of the followingprogram:

#include <iostream.h>struct GAME{ int Score, Bonus;};void Play(GAME &g, int N=10){ g.Score++;g.Bonus+=N; }void main(){ GAME G={110,50}; Play(G,10); cout<<G.Score<<":"<<G.Bonus<<endl; Play(G); cout<<G.Score<<":"<<G.Bonus<<endl; Play(G,15); cout<<G.Score<<":"<<G.Bonus<<endl; }

Application Based Questions ( 2 Marks Based on random function)

1. Observe the following C++ code and find out , which out of the given options i) to iv) are the expected correct output. Also assign the maximum and minimum value that can be assigned to the variable ‘Go’.void main(){ int X [4] ={100,75,10,125};int Go = random(2)+2; for (int i = Go; i< 4; i++) cout<<X[i]<<”$$”;}

Ans :(iv) is the correct option. Minimum value of Go = 2Maximum value of Go = 3

Page 44: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

(i) 100$$75 (ii) 75$$10$$125$$ (iii) 75$$10$$ (iv)10$$125$2. Write a user defined function DIVT() which takes an integer as parameter and returns whether it is divisible by 13 or not. The function should return 1 if it is divisible by 13, otherwise it should return0.

Page 45: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

24

3. In the following program, if the value of N given by the user is 15, what maximum and minimum values the program could possibly display?

#include <iostream.h>#include <stdlib.h>void main(){int N,Guessme; randomize(); cin>>N;Guessme=random(N)+10;cout<<Guessme<<endl;

}

4. In the following program, if the value of N given by the user is 20, what maximum and minimum values the program could possibly display?

#include <iostream.h>#include <stdlib.h>void main(){int N,Guessnum; randomize(); cin>>N;Guessnum=random(N-10)+10;cout<<Guessnum<<endl;

}5. Read the following C++ code carefully and find out, which out of the given options (i) to (iv) are the expected correct output(s) of it. Also, write the maximum and minimum value that can be assigned to the variable Taker used in the code :

void main(){ int GuessMe[4]={100,50,200,20};int Taker=random(2)+2;for (int Chance=0;Chance<Taker;Chance++)cout<<GuessMe[Chance]<<”#”; }

(i) 100# (ii) 50#200# (iii) 100#50#200# (iv) 100#50

classes &objects

Sh ort An sw er Typ e Question s (2 Mark s)

Q1.What do you understand by class and object in C++?Q2.What all members of a class are accessible to outside the class body? Q3.What do you understand by data abstraction?Q4. What do you understand by data hiding? Q5 What do you understand by Encapsulation? Q6. What is polymorphism?Q7. What do you understand by member function? How does a member function differ from an ordinary function?Q8.How does a class implements Data Abstraction and Encapsulation?

Lon g Answ er Typ e Qu estion s (4 Mark s)

Q1. Define a class train with following members. Private members

Page 46: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

25

Trainno - type int Destination -type String Distance - type float Fuel - type float

A member function calfuel() to calculate and assign value of fuel as per the following criteria:Distance Fuel<=1500 250>1500 and <=3000 1000>3000 2500

Public member:1. feedinfo(): to input train no, destination, distance and invoke calfuel() function to

assign value of fuel.2. showinfo(): to display all the details for a train.

Q2. Define a class employee with following specifications: Private members:empno integer type.ename 20 characters long String. basic,hra,da float type.netpay float type.ctotal() A function to calculate the total basic. Public member:read_data() A function to read empno, ename, basic, hra, da and call ctotal ()to calculate total. display_data() A function to display all the data members on the screen.

Constructors&Destructors

Sh ort An sw er Typ e Question s (2 Mark s)

Q1. What do you understand by constructor and destructor?Q2. What are different types of constructors?Q3.What do you understand by Default constructor? What is its role?Q4. Answer the questions (i) and (ii) after going through the following class-

class Race{ int CarNo,Track;public:

};void main()

Race(); //function 1Race(int CN); //function 2Race(Race &R) //function 3void Register(); //function 4void Drive(); //function 5

{ Race R; }(i) Out of the following, which of the options is correct for calling function 2?

Option 1 - Race T(30); Option 2 - Race U(R);.(ii) Name the feature of object oriented programming, which is illustrated by function1,

function2 and function 3 combined together.

Q5.What is copy constructor? What do you understand by constructor overloading?

Page 47: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

26

Q6. Find the output of following-

Page 48: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

2727

#include<iostream.h>class METRO

{int Mno, TripNo, PassengerCount;public:METRO(int Tmno=1)

{Mno= Tmno; TripNo =0; PassengerCount=0;

}void Trip(int PC=20)

{ TripNo++; PassengerCount +=PC;}

void StatusShow(){

cout<<Mno<<":"<<TripNo<<":"<<PassengerCount<<endl;}

};void main(){METRO M(5),T; M.Trip(); T.Trip(50); M.StatusShow(); M.Trip(30); T.StatusShow(); M.StatusShow();}

INHERITANCESh ort An w er Typ e Qu estions (2 Mark s)

Q1.What do you understand by Inheritance?Q2.What is Base class and derived class?Q3.What is difference between Multiple Inheritance and Multilevel Inheritance? Q4.What is difference between public access specifier and private access specifier?Q5.Which type of Inheritance is depicted below?

Q6.Consider the following code and answer the questions below:#include<iostream.h>class employee{ int emp_no;

char emp_name[25], emp_addr[30], emp_dept[10];

Page 49: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a

2828

public:

};

void emp_input();void emp_print();

class manager: public employee{ int no_of_emp;

public:void input();void print();

};i. Which type of inheritance is shown in the above code?

ii. Name the base class and the derived classiii. Name all the private data members of class employee iv. Nameall public member functions of class manager?

Page 50: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a
Page 51: SETH ANAND RAM JAIPURIA SCHOOL VASUNDHRA , … · CHEMISTRY 1) Select a relevant topic for the Investigatory project, collect information using various sources and compile it in a