C++ Punjabi University Question Paper

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Roll No.. Total No.

of Pages: 7

CC:A4.5 PC 1288-AH

C2043
USINGC+-B
OBJECT ORIENTED PROGRAMMING

[Maximum Marks: 70
Time Allowed: Three Hours]
attempt one question each from
Note- The candidates are required to

Sections A, B, C and D carrying 14 marks each and the entire


Section E consisting of 7 short answer type questions carrying
2 marks each.

SECTION-A
characteristics of Object oriented
1. (a) What are the unique
programming paradigm ? Explain.

(6) What do you mean by operator precedence and associativity in

7
C++? How is it used in arithmetic calculations ? Discuss.

2. (a) What do you mean by a variable ? What rules do you follow

for naming a variable ? How is it declared ? Describe with

examples.
(b) What are various logical operators in C++? Mention their syntax
(b)
and usage with a C++ program.

1288-AH-B/4110/APR-46346 [P.T.O
SECTION-B

Write a user interactive program in which user is asked to an


3. (a)
and then' calculate of all integers from 1 to
integer i.e. n sum n

using recursion.

(b) What is multidimensional array ? How is it declared and


accessed in aC+ program ? Mention relevant statements with

proper syntax. 7

4. (a) What is a pointer to function ? How do you pass pointer to


4.
function as parameter of another function ? Illustrate with a
7
small C++program.

b) Discuss following in C++

) Storage class

(i) Union. 1

SECTION-C

What do you mean bya class ? How data and function


members
5. (a)
are defined in a class using various modifiers ? Describe. 7

What do you by Friend function ? How is it different


(b) mean

from member function ? How can you make one function friend
of many classes ? 7

?
6 (a) What is inheritance? What are various types of inheritance

Describe.

1288-AH-B/4110/APR46346 2
(6) Discuss usage of following:

() Abstract Class

i) Dynamic Constructor.

SECTION-D

7. (a) What is operator overloading? How do you overload unary


operators? lustrate with a C++ program. 7

b) What is a virtual function ? How does it differ from an


overloaded function ? What are the benefits of virtual

function ? Discuss.

8.
8. (a) Discuss syntax and purpose of following functions in context

ofthe operations
seekp)
(i) getline)
7
) put().
How do you open files for reading or writing? What are various
(b)
opening modes ? Discuss.

SECTION-E
9 Explain the following in short:

(a) What do you mean by code extensibility ?


(b) What is register storage class ?

(c) When do you use nested classes ?

1288-AH-B/4110/APR46346 3 (PT.O.
What do you mean by function prototype ?
(d)
How do you use new operator ?
(e)
Differentiate between carly binding and late binding.

() What is dymamic polymorphism ? 742-14

(UFrait gerE)

2 ia J5|

STO-8

. (8) gea-gr /ararMar Hae-EAT (Object oriented programming


paradigm) à eHH EE Js ? fams a
( ) C++ fee KudeT precedence S associativity3 at 3t d?

() C+fee ri-r Ttas Gudea faa J5 ? C++ }araH


Aproto
or 7

fev qar fmi fr


fer 1?n'

fru fen

caH

m)

P.TO

You might also like