Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
28 views
10 pages
OOP Ques
Uploaded by
Nayeem Olid
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save OOP_Ques For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
28 views
10 pages
OOP Ques
Uploaded by
Nayeem Olid
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save OOP_Ques For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save OOP_Ques For Later
You are on page 1
/ 10
Search
Fullscreen
Heaven Rajshahi University of BSc. Engineeri Engineering 1* Year Even Semeste Department of Light is Our Guide MRINCCrIng & Tey ‘chnology Examination, 2017 Course No: ECE 1203 “Teetrical & Computer Engineering cree Course Ohjet g eaters hject Oriented Programming (i) Bowes in eC aking THREE fom ach set page laures inthe margin Indicate full marke =f (1) Me questions are ofequtenge ak (1) Use separate answer script for each section Section - A a) What a a ( stare the unique advantages of an object-oriented program? 03 (b)__ Find errors if any, in the following C* statements ') m=5://n=10;//s-men 7 ii) cinssx>ay; iii) cout<<\n "Name:"<
>AC Num>>Name;) Public void deposit void witha: oat amount cin>>amount AC Balance=AC. Balance amount; } int main(( Class Bank Account:Protected Account Bank Account account! {void check info() account deposite() {cout<
>a>>b;} intsum() int mainQ{ {return(a+b);} calculator general_calc int multiply) general_cale. input) {return(a*b);) general_caleall.cale void all_calc() general_calc.display(); {a=sum();b=multiplyQ);} } void display(){cout<
show(); } Page 2 of 2se No. ECE 1203 Full Marks: 72 nih emi Mn NAB. (i) Answer SIX questions taking w (11) Figures in the margin Indie (iit) Use separate answer script Jur | Section -A Q.1 (a) What is object oriented proyranaing’? Haw is it ditterent 1 oriented programming’? fv ihe (b) Distinguish the follow terms: “ (i) Objects and classes ) Inheritance and polymorphism iii) Data abstraction and data encapsulation (©) What kind of things can become abject. in QO? How stata and method oquanized 04 in an object-oriented program’? vous Q2 (a) Explain why you must be careful when passing al objects from function, Give praper example, (b) When one object is assigned to another what pu troubles or side effects occur when ane obj ‘example. (©) What is friend function? Can a friend fietion be friend. with mere than 6 Explain with example, yJecls Low Ninetion ar cetinatnye 0 icly taken place? Can any 0% sige fs quvtluc'é expuin with Q3 (8) Describe with excimples the use of enumeration data types (b) What is a friend function? Write down ane pleat Hien finetion. uw (©) Define a class to represent a bank account, Include the fallowing features: on) Data members: 1. Name of the depositor 2. Account number 3, Type of account 4, Balance amount in the account Member functions: 1. To assign initial values 2. To deposit an amount 3. To withdraw an amount afler checking the balance, 4. To display nume and balance (d)_ When do we declare a member of a cliss stat w Q4 (@)_ Whatis the “this” pointer? m (b) Write the advantages of using reference parameter, a © In what situations copy constructor is culled’? Why is iH awccsniey'? Explain willy 04) @) example. ! Show the general forms for new and delete, What ure some iulyantayes of ati Ob them instead of mulloc() und free(), Section QS (a) Whatare the different forms of inheritun ? Clive an ex (b) How do the properties of the following two « le tar euely un ived classes (lille? “ i) class p: private x (// ii) class q: publie x (//-~ (©) Write down an example code of » paramoterized jinetion having 4 detail a argument for one parameter, Page 1 of 2(Pind errors in the following program and state reasons. Minelindes sowtroam h> Jelass Y; public X [elas Z: clans X { ( public: public: te vol ft) void tt) xl i protected; int zt, 62, 235 int xx ab publi jut xa; 3 ‘ } . h Q.6 (a) Why an aperator is overloaded? Does it lose any of its functionality? Can the 0+ precedence of an overloaded operator be changed? (b) Write w program that overloads the unary operator *=-" in such a way that the 05 ‘operator finetion can be called by ‘object--" or *--object” and it decrements the valuo of all the private members by | of a class. (©) Explain why you might need to overload the assignment operator. Can operator =() be a fiend function, Q7 What happens when 1 protected member is inherited as (i) public (ji) private (iii) 03 protected? (b) When one class inherits another, when are the classes constructors called? When 03 ure their destructors called? (©) Explain why a virtual base class might be necessary. Give proper example. oy (4) What are the significance of the access specifiers in multiple inheritance? 02 Q.8 (n) What will be the output of the following code segment? os class office ( oid show() ( publi ; . it coute<"Exam will be started from 27th February"s| office *ptr_obj: } result ece: Mi gas reaul: public office ( ptr_obje>show()s} public: void show(){ cout<<"Reeult will be publiced soon"; ) (by When do we make a vets Fetion pure”? Why do we nec. virtual functions? oO (6) What are the finetions off) precision), i) 610, fi) setw0, iv) OCT osHeaven's L 8s Oup Guide Rajshahi University of E®gingcring & Technology B.Sc. Engineering 1" Year E¥¢ Semester Examination, 2019 Department of Electric@ & Computer Engineering Course No: ECE 1203 Course Title: Object Oriented Programming Full Marks: 72 ‘Time: 03 Hours N.B. (i) Answer SIX questions taking any THREE (70 4 section (ii) Figures in the margin indicate full matks. (ii) Use separate answer script for each section. SECTION.« SEA Q.lfa) What is the relationship of class and object? Explain Object Oriented Programming (OOP) 04 concept with some real life examples. 8) Discuss the functionality of “auto” and “decltype” with suitable coding. bos {6} Write down the output of the following code: lenore the syntax and declaration errors. " ()—intmaing) { int x =100; int y = (x++, +4x, x++): coute
> x; for (int m= 0, m <& x; m+){ ‘cout << “RUET 5 Convocation - 2019” << endl; } /Q3{a)_ What is destructor? Explain default constructor calling at the time of declaring object of any 03 class with code. ae 7 : Sb) Why copy constructor is necessary? ‘Why can’t you call default constructor after declaring at 04 least parameterized constructor inside the class? Write a program to copy value of one object into another object using the concept of copy Constructor. ©) Briefly discuss about different types of inheritance in C+, 0s /Q.4G) How are the base class members initialized {tom derived class? Give an example. (b) Why is it necessary to overload an operator? Give an example. (©) Write down a C++ propram in such a way tht value++ can be used to increment each member of the class where value is an object of cass GetValue, 222y akcriOn-® We know that a private member of @ base ¢}, js not inheritable, Is it anyway possihje GRP" hjects of a derived class to access the tte members of the base clas tn oe Remember the base class cannot be modifieg ys, how? ven do we make a class virtual? Discuss With example. ou yw type of problems may occur for hyp,ig inheritance? Discuss with example ang also 04 suggest the solution. Quah How many waysa fnetion can be overload shove with example (b) Using C++ syntax write down a program to merge two different files (student.xt, teacher.txt) o into another one (info.txt). - . (c) Whatare generalization and specialization? y,ite with examples. oe oh & What is meant by Error in programming? Differentiate between Error and Exception in C++ 03 programming. i ae ‘(o. Discuss exception handling mechanism using yry_catch block and throw keyword, 03 Af Write a program to design user defined excepyjon to handle the problem age of a valid voter, 03 (d) What will be the output of the following code? 0 int main() { intx = 10; ryt throw 10; } catch(char *str){ cout<< “Exception Handled” << endl; catch(: + )f cout<< “Default Exception” << endl; retum 0; } [Ss is UML? Mention some applications of UML in software development. 03 GY Discuss about Early Binding and Late Binding polymorphism. 02 SC what is diamond shape problem in multiple inheritance? Discuss the solution of this problem 04 ith adequate codes. yf Wit down the output of the following code. 03 class A { public: virtual void F1(){ cout<< “FI( ) from base"<< endl; void F2(){ cout << “F2( ) from base” << endl; class B: public Af public: void F1()f cout << “FI() from derive” << endl; } void F2( ){ cout << “F2( ) from derive” << endl; h int main( ){ A fay Bb; a=&b; a —>FI(); a =>F2(); }st oat ‘= = Gate — ce Scomtenaimen teri? ha a“ ii eeSECTION Smet songs) ge i ee en ph an sree teres ml prices mein sp ne enigma he et cial btm) nach eda! oa able um at C2 rac rn ht ees 9 cence hea Incr ps ‘ee Seg eww bo pe pens Den tm een iin ot Senn moe cane sist pica Coe ‘ine dole ptr om ede ah pi tral Sysco i amy mi zn nn iE tr mit he ni i eins emai crime A oy appa ang ip tegen ee Sr (Yep mapogam an nner enn ck 0 Circle O‘ana University of ngnering and Tecmoogy (RUST) Depart fei ans amputee 8 oe cae C1208 ese ie Ose! need Prowng Scie or ae panes ‘ie said morte eH ca Saroacgeune ater ne md aricept ene prt Axe} ‘Stoanancbertan cape open mame ‘Gtonfocepton eyo pine ep . 1, ete ante ne and snow pt ta ethane ee ep pote "eos est pute racrutingare "Petes wod mar ‘se a omnes ‘Seem op , Iemenceten , eeDepartment of Fiesta & CompaterFnginering cna Yot_ Cue Te Objet Oren Pm Cs oe BCE: 120 ss Mas 20 Spaeth itl Mame hich dent C lowing = 1 Detine oper overlong method forthe given ls tt We cua he amon fed of te bss of Maney coetaee eae i teagan 2 punters Aching a a ce inne pam Cmchpege tte Gor tomine » Sh Sm tae pn f mae ae’ Hw Co ae ns he en ai rm (emt el Sond Sa ag pric set sas sts eis erythema reson, Ey orn se ao ‘wold dran()(coutcerberv2 Chass"«sendl;} ese % , 4 Line np fe progam sven sone Ao i 8 en fees {CLO Cogatne gy
You might also like
583350232vk Xii Computer Old Question & Answers 2011-12
PDF
100% (1)
583350232vk Xii Computer Old Question & Answers 2011-12
269 pages
2016 CE104 University Paper
PDF
No ratings yet
2016 CE104 University Paper
3 pages
C++ Papers
PDF
No ratings yet
C++ Papers
9 pages
CPP October
PDF
No ratings yet
CPP October
20 pages
KIIT University PPL (IT 401) Paper
PDF
No ratings yet
KIIT University PPL (IT 401) Paper
5 pages
OOP in C++
PDF
No ratings yet
OOP in C++
25 pages
BCA-II Sem-IV CPP Journal 2024-25
PDF
No ratings yet
BCA-II Sem-IV CPP Journal 2024-25
16 pages
Model Test Paper 4
PDF
No ratings yet
Model Test Paper 4
9 pages
Oct 24 Bba (CA) CPP Solution
PDF
No ratings yet
Oct 24 Bba (CA) CPP Solution
11 pages
2019 August I-II
PDF
No ratings yet
2019 August I-II
98 pages
2016 - 1st Internal Paper
PDF
No ratings yet
2016 - 1st Internal Paper
2 pages
Object Oriented Programming: Time: 2 HRS.) (Marks: 75
PDF
No ratings yet
Object Oriented Programming: Time: 2 HRS.) (Marks: 75
16 pages
OOP Final Exam Fall 24 - Soln
PDF
No ratings yet
OOP Final Exam Fall 24 - Soln
21 pages
C++ 5 Year
PDF
No ratings yet
C++ 5 Year
15 pages
Oop With.c++ - 5-12-18
PDF
No ratings yet
Oop With.c++ - 5-12-18
3 pages
Cse Ass2024
PDF
No ratings yet
Cse Ass2024
4 pages
C++ Pro QP
PDF
No ratings yet
C++ Pro QP
8 pages
Q-1: Explain The Concept of Constructers and Destructors in C+ + With Programming Examples
PDF
No ratings yet
Q-1: Explain The Concept of Constructers and Destructors in C+ + With Programming Examples
21 pages
Object Oriented Programming in C++
PDF
No ratings yet
Object Oriented Programming in C++
18 pages
Object Oriented Programming With C++
PDF
No ratings yet
Object Oriented Programming With C++
9 pages
Oops in C++ INTERVIEW SERIES - 2
PDF
No ratings yet
Oops in C++ INTERVIEW SERIES - 2
24 pages
2017 Summer Model Answer Paper
PDF
No ratings yet
2017 Summer Model Answer Paper
33 pages
Answer BC0037 C++
PDF
No ratings yet
Answer BC0037 C++
20 pages
Msbte w22 22316
PDF
100% (4)
Msbte w22 22316
27 pages
May Jun 2022
PDF
No ratings yet
May Jun 2022
2 pages
Be Computer Engineering Semester 3 2022 May Object Oriented Programming Oop Pattern 2019
PDF
No ratings yet
Be Computer Engineering Semester 3 2022 May Object Oriented Programming Oop Pattern 2019
2 pages
Be - Electronics and Telecommunication Engineering - Semester 4 - 2022 - May - Object Oriented Programming Oop Pattern 2019
PDF
No ratings yet
Be - Electronics and Telecommunication Engineering - Semester 4 - 2022 - May - Object Oriented Programming Oop Pattern 2019
2 pages
CE - 144 OOPC++ Practical List
PDF
No ratings yet
CE - 144 OOPC++ Practical List
13 pages
Final Solve
PDF
No ratings yet
Final Solve
10 pages
Oop Imp Questions
PDF
No ratings yet
Oop Imp Questions
19 pages
C++ QUESTION PAPER 2022 (Oct )
PDF
No ratings yet
C++ QUESTION PAPER 2022 (Oct )
15 pages
C++ Important Questions
PDF
No ratings yet
C++ Important Questions
8 pages
18BCS33C U3
PDF
No ratings yet
18BCS33C U3
142 pages
Null 2
PDF
No ratings yet
Null 2
4 pages
Introduction To C++ (Part1)
PDF
No ratings yet
Introduction To C++ (Part1)
24 pages
CPP Questions
PDF
No ratings yet
CPP Questions
7 pages
IAT1-QB - Answer Key
PDF
No ratings yet
IAT1-QB - Answer Key
5 pages
2015 CE104 University Paper
PDF
No ratings yet
2015 CE104 University Paper
4 pages
XXXXX: Important Instructions To Examiners
PDF
No ratings yet
XXXXX: Important Instructions To Examiners
22 pages
Apr 2023 B.B.A (C.a) 2019 Pattern - CPP - Solutions
PDF
No ratings yet
Apr 2023 B.B.A (C.a) 2019 Pattern - CPP - Solutions
17 pages
Employee Details: Page 1 of 7
PDF
100% (1)
Employee Details: Page 1 of 7
7 pages
2022 External Paper
PDF
No ratings yet
2022 External Paper
2 pages
Final Oop Paper Spring 2020
PDF
No ratings yet
Final Oop Paper Spring 2020
5 pages
5-Object Oriented Programming
PDF
No ratings yet
5-Object Oriented Programming
148 pages
Bca 3
PDF
No ratings yet
Bca 3
35 pages
Oop Bei Pyqs
PDF
No ratings yet
Oop Bei Pyqs
2 pages
2024 Summer Model Answer Paper
PDF
0% (1)
2024 Summer Model Answer Paper
28 pages
1) What Is Encapsulation?
PDF
No ratings yet
1) What Is Encapsulation?
11 pages
1120231-CO - OOPS All MSBTE Board Paper With Solution
PDF
No ratings yet
1120231-CO - OOPS All MSBTE Board Paper With Solution
72 pages
Grapecity Paper
PDF
No ratings yet
Grapecity Paper
19 pages
Oop Merged
PDF
No ratings yet
Oop Merged
12 pages
Oop - Exam Set A
PDF
No ratings yet
Oop - Exam Set A
4 pages
2015 CE104 1st Internal Paper CE IT
PDF
No ratings yet
2015 CE104 1st Internal Paper CE IT
3 pages
Cs304 Oop Compiled MCQ
PDF
75% (4)
Cs304 Oop Compiled MCQ
140 pages
OOP Kit
PDF
No ratings yet
OOP Kit
68 pages
Oop Winter 2019 (C++)
PDF
No ratings yet
Oop Winter 2019 (C++)
21 pages
Bcs 031
PDF
No ratings yet
Bcs 031
25 pages
C++ 60 Questions
PDF
No ratings yet
C++ 60 Questions
4 pages
Oops April 2017 Set 1
PDF
No ratings yet
Oops April 2017 Set 1
3 pages