assignment oops & c++ [mca-303]

7
Gyan Ganga Institute of Technology & Sciences, Jabalpur MCA – III Semester Assignment/Tutorial Questions Subject: Object Oriented Methodology & C++ [MCA-303] UNIT – I 1. What is copy constructor? Explain all cases with examples in which a copy constructor is invoked. 2. What is meant by independent references? What are the restrictions to references? Write program to demonstrate the use of function returning reference. 3. What is the need of object-oriented programming? How does it provide betterment than procedure oriented language? 4. Design structure named distance including function? Illustrate their utility respect to memory allocation. 5. Illustrate the role of precedence in arithmetic and relational operators using suitable example? 6. What is the use of new operator? Give various form of new operator. What are the advantages of new over malloc function? Explain with the help of examples. 7. What is constructor and destructor function? Illustrate their utility with respect to memory allocation. 8. Design structure named distance including function? Illustrate their utility respect to memory allocation. 9. Compare abstraction and encapsulation. Give the advantages and disadvantages of polymorphism in an object oriented system.

Upload: anand-baghel

Post on 28-Jan-2016

216 views

Category:

Documents


0 download

DESCRIPTION

C++ short answer

TRANSCRIPT

Page 1: Assignment OOPs & C++ [MCA-303]

Gyan Ganga Institute of Technology & Sciences, JabalpurMCA – III Semester

Assignment/Tutorial QuestionsSubject: Object Oriented Methodology & C++ [MCA-303]

UNIT – I

1. What is copy constructor? Explain all cases with examples in which

a copy constructor is invoked.

2. What is meant by independent references? What are the

restrictions to references? Write program to demonstrate the use

of function returning reference.

3. What is the need of object-oriented programming? How does it

provide betterment than procedure oriented language?

4. Design structure named distance including function? Illustrate

their utility respect to memory allocation.

5. Illustrate the role of precedence in arithmetic and relational

operators using suitable example?

6. What is the use of new operator? Give various form of new

operator. What are the advantages of new over malloc function?

Explain with the help of examples.

7. What is constructor and destructor function? Illustrate their utility

with respect to memory allocation.

8. Design structure named distance including function? Illustrate

their utility respect to memory allocation.

9. Compare abstraction and encapsulation. Give the advantages and

disadvantages of polymorphism in an object oriented system.

10. What is containership and delegation? How does it differ from

inheritance?

Page 2: Assignment OOPs & C++ [MCA-303]

Gyan Ganga Institute of Technology & Sciences, JabalpurMCA – III Semester

Assignment/Tutorial QuestionsSubject: Object Oriented Methodology & C++ [MCA-303]

UNIT – II

1. Write briefly about the following:

a) Access modifiers

b) Inheritance

c) Pointers

d) Type conversion

2. What is the major difference between overloading [] operator and ()

operator. Write a program to demonstrate the overloading of []

operator.

3. Create a class date with integer date members for hours, minutes

and seconds. One constructor should initialize it to 0 and another

to a fixed value. A member function to display it in 11:59:50 format

and an overloaded + operator to add two times. Write a program to

test this class.

4. What do you mean by access modifiers?

5. Where does protected access find its use?

6. Define the terms:

a) Type conversion constructor

b) Conversion operator function

Also describe how they are used in user defined conversions.

7. Overloaded operator binary subtraction (-).

8. What is inheritance? What are its types?

9. Differentiate between the early binding and late binding.

10. Discuss Multiple Inheritance.

Page 3: Assignment OOPs & C++ [MCA-303]

Gyan Ganga Institute of Technology & Sciences, JabalpurMCA – III Semester

Assignment/Tutorial QuestionsSubject: Object Oriented Methodology & C++ [MCA-303]

UNIT – III

1. Write brief on the following:

a) Early and late binding

b) Virtual functions

2. Create a base class called figure and store two double type values

to compute the area of figures. Derive two classes called triangle

and rectangle from this base class. Base class should contain

get_data() to initialize date members and display_area() to compute

the area of figures. Make display_area() as virtual and redefine this

in derived this in derived class to suit their requirements. Include

these classes in a program to accept dimension of a triangle or a

rectangle interactively and display the area.

3. What is pure virtual function? Write a program to demonstrate it.

4. What is virtual function what are the properties of virtual function?

How will you achieve run time polymorphism using virtual

function?

5. Explain the term virtual base class?

6. What are the characteristics and the rules that need to be followed

with friend function?

7. Write a program in C++ which use the ‘try’, ‘catch’ and ‘throw’

functions.

Page 4: Assignment OOPs & C++ [MCA-303]

Gyan Ganga Institute of Technology & Sciences, JabalpurMCA – III Semester

Assignment/Tutorial QuestionsSubject: Object Oriented Methodology & C++ [MCA-303]

UNIT – IV

1. Explain formatted I/O in C++ using suitable illustrations.

2. Can you create your own inserters and extractors? Discuss how?

3. Write a program using inserter function to printer the following

triangles of asterisks:

*

**

***

****

4. Write the general form of seekg() and seekp() function. Write a

program to update the nth record of a given file.

5. Write a program to read disk file.

6. What are the manipulators? How and where they are used? For

what purpose width() & seek() are used?

7. Write in brief about exception handling fundamentals.

8. Write a program to catch class type exception.

9. How formatting can be done with ios class give example.

10. What are the uses of the following ios class fmt flag?

a) Adjust field

b) Dee

c) Internal

d) Right

Page 5: Assignment OOPs & C++ [MCA-303]

Gyan Ganga Institute of Technology & Sciences, JabalpurMCA – III Semester

Assignment/Tutorial QuestionsSubject: Object Oriented Methodology & C++ [MCA-303]

e) Skipws

UNIT – V

1. What is UML? What are the basic building works of UML?

2. Draw the class diagram, object diagram and activity diagram for

bank.

3. Classify different UML diagrams available giving one example for

each.

4. Elaborate the criteria that you will look for when you are

identifying classes and for certain project.

5. Illustrate the usage of collaborate diagram.

6. Give the difference between class diagram and object diagram.

7. Explain the relationship between component diagram and

deployment diagram with suitable example.

8. Perform OOA and OOD for examination results display system of a

university on the following points :

a) Identify actors and their responsibility

b) Draw detailed use case diagram

c) Draw design class diagram