‘ ROI NO. cece cesses
E-1/125/18
I Semester Examination, December, 2018
[Link].
INFORMATION TECHNOLOGY
Paper |
(Object Oriented Programming with C++)
Time : 3 Hours ] [ Max. Marks : 100
Note : Question Paper comprises of 3 sections.
Section A is objective type/multiple choice of
10 marks. Section B is short answer type of
30 marks. Section C is long answer type of 60
marks. 5
SECTIONA 1x10=10
(Objective Type Questions)
1. Which of the following is not the member of
class ?
(a) Static function (b) Friend function
| (c) Constant function (d) Virtual function
2. Which allows you to create a derived class that
inherits properties from more than one base
class ?
(a) Multilevel inheritance soon Baateett2y
(b) Muttipte inheritance 1a
(©) Hybrid Inheritance
7 The address of a variable temp of type oat Is :
(@) Hierarchical Inheritance (a) stem, (b) Gctemp
(©) Mloatétemp (a) Moat tempé
8. Default value of static variable is Zi
@o oI
What ts the output of the following code :
char symbol{3} = {a
(0) Garbage value
(4) Compiter dependent for (int index=0; ind&x<3; index+s)
4, The explicit keywo ‘cout << symbol lindex
abe (6) “aber
(o) abe.
a Is an optional decoration
for the constructors that takes exactly
argument.
(@) No argument —(b) Two
(4) None of the above
(c) Three
9. Which functions allows to change the location
(©) One of the get and put positions ?
5. The operator that cannot be overloaded ig : (2) se) andl sp() "(8 Seg) ana seep)
Ge Os (6) gog() and gop() (4) seekg{) and seekpt)
0 a 10. To perform stream 1/0 with disk ies in Cee,
6. Overloading the function operator : you should : -
() requires 1 (a) open and close files as in procedural
0)
Fequires a class with an overload,
led]
operator.
languages
(b) use classes derived from ios
(use C language library functions to read
and write data
(@) include the [Link] header file.
(}_ allows you to create objects that act |
syntactically like functions
(@ usuany
rake use of a constru
ictor that
arguments,
PTO.
E-1/128/18Discuss the use of enumeration data type in
CH,
Unit or
5. Differentiate between private and protected _
specifier with example.
Or
Explain null and default constructor.
Unit IV
Discuss with example.
E-1/125/18
t54
or
How pure virtual functions ts differ from virtual
functions ?
Unit v
}. List and explain various functions required for
random access file operations.
Or
Write C++ program to retrieve information from
the file.
SECTIONC 125-60
(Long Answer Type Questions)
Unit r
1, Define Object-oriented programming and explain
feature of Object-oriented programming. How it
is different than procedure-oriented programm-
ing?
or 4, iia
Differentiate between break, continue and goto
statement in C++,
Unit
2. What ts inline function ? In which situation
inline function may not work ? Hew does an
E-1/125/18 PTO.4
161
Inline function may difer from a preprocessor
macro ? Write program using inline function to
find largest of three numbers,
Or
Discuss nesting of structure and union with the
help of suitable example.
Unit 1
What is the ambiguity that aries in multiple
inheritance ? How it can be overcome ? Explain
with example.
Or
What is multi-dimension array ? Write a C++
program to count total number of duplicate
elements in an array.
Unit IV
Write a C++ program demonstrate use of the
pure virtual function with the use of base and
derived classes.
Or
Why friend function is required to overload
binary operator ? P
x ©) this.x
(0 “this (@ “this-x,
8. Avirtual member funetion is a mem
ber Funct,
that can : qi
(a) Be overridden by a subclass
(0) Be derived from another class
(6) Move to any class
(@) None of them,
9. tos::trune is used for ?
£9) I the fle ts opened for output operations
and its already existed, no action is taken,
1) I the fle is opened for output operations
and its already existed, its previous content
'S deleted and replaced
ed by the new one
Panasyig
Note:
158 sons
1 operat
4 for output -
fo) tf te file 19 opened for oT COPY
sted, he
nly existed
—o e current position
oe
(W)lostier
(a) ioszcurr
(@ fosz:current.
(otosseur
sectios oo
sane ge Qn
tog estos.
re oe pga to chek get ber
: see three numbers using nested if-else
Sorcment Als explain
or
biferenite between break and continue
statement with stable example.
tie
2, What are the benefits of inline function ? Explain
it. ee
Or
How passing reference arguments into function?
Explain with example.
F-1/125/19
PTO,16)
9. Deseribe memory
‘OFY allocation
suitable esampte, 1 obec
a wi
Write any C++ program t
plain pointer to oly
(© object with suttat
: table exampre
What are Cx,
"Pat are C+ stream class ? Explain i,
Or
Explain manipulators with example
SECTIONC
(Long Answer Type Quest
: ype Questions)
Note : Answer the following questions,
examples, oe
12x$=60,
Or
Describe the control structures with examples,
2. Write a :
Write a C++ program to store and display the
‘cords (rolino, name, marks of any three
F-1/125/19
a ee
in
sees of te total mats fF 86
mean by funetion overloading ? 18
what do function ts useful
vrteh situation overloaded
Teaser ? Explain with suitable example
ow static data member and stati member
functions are differences from normal data
viper and function ? Explain with suitable
examples,
or
‘What are the benefits of constructor ? Describe
types of constructor with example.
4, Explain the following
(a) This pointer, _(b) Friend class.
Or
Describe the concept of polymorphism with
suitable example in details.
5. Explain read and write operations, also write a
C++ program to perform the reading and writing
operations in file handling method as
following :
F-1/128/19 PLO.ts)
This is Writing Operation
Enter Your Name - Ravi Kumar
‘This is Reading Operation
Entered Name is - Ravi Kumar
Or
How to access a file through Random Access
‘method Is C++ ? Explain with suttable example,
ete ttotbees
F-1/125/19 are
Roll No.
‘April-2021
1125/21
1 Semester Examination,
[Link].
INFORMATION TECHNOLOGY
PaperI
Programming, with C4)
Tine:
si wa computer. Question Paper comprises of 2
Note Al tins plane Coe to
sections, Section fe ection Bis short ance type
a con Cis tng answer iypeeith itera oie
SECTION‘’
(Multiple Choice Questions)
Choose he coc answer aed
T which concept allows you to reuse the written code?
(@) Encapsulation (0) Abstraction
(9 Inheritance (2) Polymorphism
2. The default standard input device for C+ program is:
(@) Mouse (©) Scanner
(0 Keyboard (@) None of the above
3. Which of the following feature of OOPs is not used in the
following Cr+ code?
cass A
inti
public:
PTO.Ry
void print)
; Prin) fooutshella” ea)
ol
_ fa) leftmost (by rightmost
(2) topmost
Void assign (int aj
i
What happens if acer forgets to define a constroctr fale 8
clase?
(@) Abstraction
fa) Error occurs (©) Segmentation faut
(©) Encapsulation 2 i:
(6) Inheritance (© Objects
aaa (4) Polymorphism
. Out ofthe follow
wing, which is nota mer
(2) static funetion ec aes
re not created properly
(ay Compiter provides a defltcorstrocor to avoid fault!
© fe nc
(©) constant function a
Which header file is used for reading and writing toa Sle?
we
eae (@) virtual function
is the meaning of the following declaration ?
Jndeciosteeam (b) tincludeststream>
(© fineludecfile> (4) Fincludesfe>
40, Which function allow changing the location of the get and
putting positions.
int pia)
() pisarray of pointer to pela
©) pis pointer to function
(©) pis pointer to such function wh
{@) sehand sp) ©) sekgQ and sekpO
hich return
(4) pis pointer to array of function type isthe array
(© gog0 and gop0 (2) seekgQ and seek)
6 What are m
# are mandatory parts inthe function declarat
SECTION'B’ 6x5=30
©) return type,
(Ghort Answer Type Questions)
[Note Answer thefllosing question i 250 0rd.
1. Explain basic concepts of Object Oriented Programm’
fanction name
(©) return type, function name, paramé
(©) parameters, function nam =
(@) parameters, variables
Or
vazsie1 Discuss dynamic initiation of variable with, suitable
example.
Gans
PTO.function over iy
ing
Wn ie
hat do you my
ambiguity arise 7 Bang Ambiguit
uy ae? Espana? I
+ How pure virtual le. tie
3. How endl and
example,
List
any five library classes that
plain with example,
Note: Anssver the
1 Whe
Stelement infor and while loop with example,
Expl
Or :
How p.
Pass structure
eample **SRUMNI no fany
4 Discuss the need of f
fuanet
Explain with von diferent
example. om it hey
‘tan
Or
Write a Coe pro
Printandfaetion 4 big 05 nang
500 manipulator works ? Expiin
Or
# handle streams in Coy
SECTION’
Long Answer Type Questions)
Following questions in 500 words.
am cnirol structure ? Discuss use of break and cont
Or
hn the type conversion from basi
version from basic type to elas
'VP° to basi ype with proper ceampes
wt
i
members are different form
or
1? In which situation inlien function may
re ancion aye 9 PS
20 tem Explain with example.
a lor ? Give its use. When it is used
fo? Explain with suitable example.
what sinline function
uct
What is copy const
nplicty for what purpos
or
show
riveteand protected access specifier and
when they ate inherited as public, private and
Explain public,
that viiy when
protected.
4. Define operator overloading, Explain how to overload unary
eperator and binary operator
oO
Write a Cit program to create class mother having data
member to store salary of mother, ceate another clas father
Store salary of father. Use fiend function which accept object
of father and mother and print salary of mother and father
5: Write short notes on the felling:
(0) Random aces le processing,
(b) Manipulator.
Or
Write C++ program to createa text file, check file created or not.
created it will write some text into the fle and then read the
text from the file.
ecc0c0cc cco}
Gansrat
5175ee
ae og Roll No:
AM-12" ;
jester Examination, December 2022
seme?
a [Link].
INFORMATION TECHNOLOGY
Paper I
(Object Oriented Programming with C++)
Time : 3 Hours ] { MAXIMUM MARKS : 100
[ P.M. : 40
Note : All questions are compulsory. Question Paper
comprises of 3 Sections. Section A is objective
type/multiple choice questions with no internal
choice. Section B is short answer type with internal
choice. Section C is long answer type with internal
choice.
Section ‘A’
(Objective Type Questions)
Choose the correct answer : 1x10=10
1. One of the alternatives to nested if is the :
(a) Break statement (b) Jump statement
(c) Switch statement (d) Both (a) and (b)
2.
Choose the option below which is not a member
of the class :
(a) Friend Function (b) Static Function
(c) Virtual Function (d) Const Function
P.T.O.© following
ME Shots
ature my eqy
© Polymorpnisn
(0) Messy
SEE Passing (@) Bot
ie *h (ay
0) teri
ee
ma Gy,
Fate a g
from ve
MOTE than ones
one
ows
™ YoU to 6,
thacinhersts properties
class.
(2) MAEVE inher,
© Mulupte in tay
‘eritance.
©) Hybria inheritance
(b) By declaring a virtual function
class
in the base
the class declaration
(d) None of the above
AM-125
So correct
i following statements Isc
grammy
6 ee id function in C++ programming,
cess private
(a) A friend function 1s able to access
© members of a class .
he protected
(o)A fiend function ean access the P'
members of a class
ne public
{c) A friend function is able to access the Pp
members of a class
(@) All of the above
7. Which among the following can’t be used for
polymorphism ?
{@) Static member function
{b) Member funetion overloading
(6) Predefined operator overloading
(@) Constructor overloading
Which of the following syntax is incorrect for
the class definition ?
fa) Student class (};
(b) Class student. {student (int a) { Vk
(©) Class teacher (public : teacher (int a) {}):
(@) None of the Mentioned:
AM-125, per: 2
8 Which of the following ts not used
opening mode > i “ “a
fl ios ss trune py tos:
a w binary
fC) Tos : sin (08 sate
10. cin is
() Class, (6) Object
(0) Package (a) Namespace
Section “B
(Short Answer Type Questions) 65.35
Note : Answer the following questions
words. msg
What ts Encapsulation ? Explain how is
achieved in C++?
or
Explain the usage of break and continue with
example.
- What is inline function ? Also define templat
What is enumeration data type explain wit
example ?
memory? How memory is dynamically allocat
and deallocated in C++?
en wat fe TS
.
or
Write a program in C++ to write and read a text
from the file
Seetion °C"
(Long Answer Type Questions) 12x5=60
Note : Answer the following questions in 500
words,
1. Explain various operators available in C++ with
example,
Or
Write a program in C++ to check a number is
prime or not.
AM-125,
PTO.
AM-125(6) her
spenee and return
2. Deseribe call by reference by
reference with suitable example.
Or
What is the difference between structure and —
? How to access the member of a structure
variable using pointer ?
3. What are the different types of constructor,
explain with example ?
Or
Write a program in C++ to implement multileye]
inheritance.
4. Describe friend function and friend class. Wri :
a program in C++ to find largest of two numbers.
Or
Write a program in C++ to overload binary
operator ‘+’.
5. Write short notes on the following :
(i) File modes
(ii) eof ()
(iii) get (), put ()
Or
Explain the various file handling operatic
available in C++,
SGSteeceeegee |
AM-125 6/50