0% found this document useful (0 votes)
246 views

Question Paper 2021 Introduction To Object Oriented Programming

The document is an introduction to object oriented programming course outline that includes: 1) Three sections covering true/false questions, short answer questions, and long answer questions about object oriented programming concepts in C++. 2) Section A contains 15 true/false questions about topics like classes, inheritance, pointers, and functions. 3) Section B contains 6 short answer questions worth 5 marks each about constructors, references, overloading, friend functions, and classes. 4) Section C contains 3 long answer questions worth 10 marks each about inheritance, binding, and accessing data members.

Uploaded by

Mohd Kaif
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
246 views

Question Paper 2021 Introduction To Object Oriented Programming

The document is an introduction to object oriented programming course outline that includes: 1) Three sections covering true/false questions, short answer questions, and long answer questions about object oriented programming concepts in C++. 2) Section A contains 15 true/false questions about topics like classes, inheritance, pointers, and functions. 3) Section B contains 6 short answer questions worth 5 marks each about constructors, references, overloading, friend functions, and classes. 4) Section C contains 3 long answer questions worth 10 marks each about inheritance, binding, and accessing data members.

Uploaded by

Mohd Kaif
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

JAMIA HAMDARD

School of Engineering Sciences and Technology


Department of Computer Science & Engineering

BCA 2nd Year III Semester 2021-22

Subject: Introduction of Object Oriented Programming (BCA - 301)

TIME: 3 Hours MAX. MARKS: 75

SECTION – A (35 Marks) CO*: 1, BL*: 1,2,4 and 5


 State whether the following statements are TRUE or FALSE. Give reasons for your answers.
1) The computer will carry out the instructions that follow the symbol //
2) A program must have a main function?
3) There is no limit on the size of the numbers that can be stored in the int data type?
4) It is not possible to achieve inheritance of structures in C++?
5) C++ uses a this pointer value at runtime to track which object is being used when a class' method is
called?
6) Typically, class constructors are overloaded to provide many convenient ways to create an object?
7) With the declaration: class Foo : public Bar
Every instance of a Foo is a special kind of Bar.
8) When reading text, the standard >> operator will break on whitespace?
9) The body of a while loop always executes at least once?
10) A function may have any number of return statements each returning different values?
11) Names of functions in two different files linked together must be unique?
12) A pointer to a block of memory is effectively same as an array?
13) It is not possible to create an array of pointer to structures?
14) Once a method is marked virtual in a parent class, every subclass has that virtual method, whether
they say it not.
15) Inheritance is a way that programmers can implement a "HAS-A" or "part-of" relationship.

 Fill up the blanks.


16) ………………..are used to define generic classes in C++.
17) ………………..Keyword is used to define a class template.
18) In C++, ………………..is a pointer to the invoking object of the class type.
1
19) An object has state, behavior and ………………..
20) A ……………….. organizes different data items so that they can be referenced as single unit.
21) A destructor function of a base class may be declared as ………………..
22) In C++, ……………….. keyword is used to force the compiler to generate only one copy of any
repeated base class when the base class is inherited twice.
23) In C++, void pointer can be assigned only to a ………………..
24) The ……………….. is used for terminating strings.
25) ……………….. functions implement polymorphism.

 Choose correct answer.

26) What would be printed by the following statements?


int y[3][3] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
cout << y[1][2];
(a) 5 (b) 6 (c) 2 (d) 4
27) Which operator has the highest precedence?
(a) . (b) * (c) [] (d) &
28) Which of the following features must be supported by any programming language to become a
pure object-oriented programming language?
(a) Encapsulation
(b) Inheritance
(c) Polymorphism
(d) All of the above
29) Which of the following is the correct syntax to read the single character to console in the C++
language?
(a) read ch()
(b) getline ch()
(c) getch()
(d) scanf(ch)
30) For inserting a new line in C++ program, which one of the following statements can be used?
(a) \n
(b) \r
(c) \a
(d) None of the above
31) Which of the following statements is correct about the formal parameters in C++?
(a) Parameters with which functions are called
(b) Parameters which are used in the definition of the function
(c) Variables other than passed parameters in a function
(d) Variables that are never used in the function

2
32) What happens if the following C++ statement is compiled and executed?
int *ptr = NULL;
delete ptr;
(a) The program is not semantically correct
(b) The program is compiled and executed successfully
(c) The program gives a compile-time error
(d) The program compiled successfully but throws an error during run-time
33) Which of the following is correct about this pointer in C++?
(a) this pointer is passed as a hidden argument in all static variables of a class
(b) this pointer is passed as a hidden argument in all the functions of a class
(c) this pointer is passed as a hidden argument in all non-static functions of a class
(d) this pointer is passed as a hidden argument in all static functions of a class
34) Which of the following type is provided by C++ but not C?
(a) double
(b) float
(c) int
(d) bool
35) What is Inheritance in C++?
(a) Deriving new classes from existing classes
(b) Overloading of classes
(c) Classes with same names
(d) Wrapping of data into a single class

SECTION – B (20 Marks)

 Attempt any FOUR questions. Each question is of 5 marks.

Q. No. Questions CO* BL*

List the characteristics of a constructor. Write a C++ program to define a suitable


L2,
1. parameterized constructor with default values for the class distance with data members CO1
L3
feet and inches.

L1,
2. What is a reference variable? What is its major use? Give one programming example. CO1
L2

L1,
What do you mean by overloading of a function? When do we use this concept? Justify
3. CO2 L2,
your answer with proper example.
L3

4. What is a friend function? Explain the special characteristics of a friend function with CO3 L1,

3
suitable examples. L2

Write a C++ program to create a class called STRING and Implement the following
operations. Display the result after every operation by overloading the operator <<.
L3,
5. I. STRING S1= 'VTU' CO2
L6
II. STRING S2 = 'BELGAUM'

III. STRING S3 = S1+S2 (Use copy constructor).

Write a C++ program using class ITEMS that will create a shopping list where you can add
L3,
6. or delete the item from a list, find the total values (in Rs.) of the all items and display the CO3
L6
list with cost of the items.

SECTION – C (20 Marks)

 Attempt any TWO questions. Each question is of 10 marks.

Q. No. Questions CO* BL*

List the types of inheritances and explain with examples. Write a C++ program to L1,
1. CO1
implement hierarchal inheritance with public access specific. L3

Differentiate between early binding and late binding, with an example explain how late L2,
2. CO2
binding can be achieved in C++. L3

Describe the mechanism of accessing data members and member functions in the
following cases with suitable examples:
L2,
3. a) Inside the main program CO3
L4
b) Inside a member function of the same class
c) Inside a member function of the another class

L1,
What is an operator function? Describe the syntax of an operator function. Write a
4. CO2 L3,
program to overload ‘+’ operator to concatenate two strings.
L6

CO* - Course Outcomes from Syllabus, BL* - Bloom’s Taxonomy Levels (1: Remembering, 2: Understanding,
3: Applying, 4: Analyzing, 5: Evaluating, 6: Creating)

END
4

You might also like