You are on page 1of 15

VALLIAMMAI ENGINEERING COLLEGE

SRM Nagar, Kattankulathur 603 203

DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

QUESTION BANK

BE Electrical and Electronics Engineering


IV SEMESTER
CS6456 OBJECT ORIENTED PROGRAMMING
Regulation 2013
Academic Year 2016 17

Prepared by
Mr.T. Rajasekaran &
Mr. N. Leo Bright Tennisson
VALLIAMMAI ENGINEERING COLLEGE
SRM Nagar, Kattankulathur 603 203.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

QUESTION BANK

Year & Semester : IV


Section : EEE - 1 & 2
Subject Code : CS6456
Subject Name : Object Oriented Programming
Degree & Branch : B.E & EEE
Staff in charge : Mr.T. Rajasekaran and Mr. N. Leo Bright Tennisson

UNIT-1

UNIT I OVERVIEW
Why Object-Oriented Programming in C++ - Native Types and Statements Functions and
Pointers-Implementing ADTs in the Base Language.

PART A (2 MARKS)

S.
QUESTIONS COMPETENCE LEVEL
No
1. Lists some characteristics of object-oriented language. Remember BTL1
2. With respect to C++ distinguish objects and classes. Understand BTL2
3. Evaluate Procedural programming with OO programming. Evaluate BTL5
4. Analyze how data encapsulation supports reusability Analyze BTL4.
5. Create a friend function which violates encapsulation? Create BTL6
6. Classify the native types in C++. Understand BTL2
7. Create an example for Enumerated data types. Create BTL6
8. Discuss a statement/Expression with an example? Understand BTL2
9. Examine function prototype and give an example. Apply BTL3
10. Summarize pointer and outline pointer arithmetic. Evaluate BTL5
11. Compare pointer and a reference? Analyze BTL4
12. Show the syntax to dynamically allocate memory to a constructor. Apply BTL3
13. What is function overloading? List out its advantages. Remember BTL1
14. What are inline functions? Give an example. Remember BTL1
What is an Abstract Data Type? Give an example and how it
15. Remember BTL1
differs from class?
16. Differentiate between stack and queue and give its applications. Understand BTL2
17. How Struct relates with Union/Class. Give an example. Apply BTL3
18. Point out the operations supported by the list ADT? Analyze BTL4
19. Define Type casting. Remember BTL1
20. List out various formats of bit field. Remember BTL1

PART B (13 MARKS)


S.
QUESTIONS COMPETENCE LEVEL
No
i) Explain the features of object oriented programming. (6)
1. Understand BTL2
ii) Describe how each of these features is implemented in C++ (7)

Explain the following elements available in C++ with neat illustration


of each.
i) Data types (2)
2. Evaluate BTL5
ii) Control statements (5)
iii) Operators (2)
iv) Storage classes (4)
Analyze the concept of
i) call by value and (6)
3. Analyze BTL4
ii) call by reference (7)
with a programming example.

4. Design an algorithm and diagrammatic illustrations the various Create BTL6


operations that can be performed on a Stack/Queue ADT?

i) How would you declare function to be a constant in C++? (6)


5. ii) What are the properties of such function? Explain with a demo Remember BTL1
program. (7)

i) What are inline functions? (2)


ii) What are advantages of inline functions? Give an example. (6)
6. Remember BTL1
iii) What is the rules to be followed while defining inline functions?
(5)
Examine a program to check how many instances of a class are
7. Remember BTL1
created using the static member function.
i) Summarize various type conversions? (6)
8. Understand BTL2
ii) Explain each with a program. (7)
i) How would you declare function with default argument in C++?
9. (6) Apply BTL3
ii) Demonstrate with a demo program. (7)

i) Write an object oriented code where a member function of a class


reads a set of numbers upto n and print the contents of the array in
10. reverse order. This function is called by pointer to member function of Apply BTL3
the class. (10)
Test the code with data. (3)

Explain the following program elements of C++ with syntax and


example
11. Analyze BTL4
i) Constructors (10)
ii) Destructors (3)
Discuss the following
i) Various operators that are available in C++ with neat
12. Understand BTL2
illustration for each of it (7)
ii) Use of Pointers with Array (6)

i) Describe encapsulation with example (6)


13. Remember BTL1
ii) Describe C++ exception with example (7)

i) Explain the structure of a C++ Program (8)


14. Analyze BTL4
ii) Write a C++ program using try and catch construct (5)

PART C (15 MARKS)


S.
QUESTIONS COMPETENCE LEVEL
No
i) Explain the advantages and disadvantages of structured
programming. (7)
1. Understand BTL2
ii) Describe the advantages and disadvantages of Object Oriented
Programming (8)
Explain the following with programming example.
2. Evaluate BTL5
i) Use of Constructors and Destructors
Analyze the following
i) Advantages and Disadvantages of Pointers (7)
3. Analyze BTL4
ii) Can Pointers be avoided in Object Oriented Programming (8)
with a programming example.
4. Design an algorithm to show prefix expression evaluation using Create BTL6
Stack ADT?

UNIT-2

UNIT II BASIC CHARACTERISTICS OF OOP


Data Hiding and Member Functions- Object Creation and Destruction- Polymorphism data
abstraction: Iterators and Containers.
PART A (2 MARKS)
S.
QUESTIONS COMPETENCE LEVEL
No
1. List the two types of polymorphism? Give an example for each. Remember BTL1
2. Recall the operators in C++ which you cannot be overloaded. Remember BTL1
3. Classify the use of keywords void/new/delete. Analyze BTL4
4. Give the use of scope resolution operator. Understand BTL2
5. Define an abstract class with an example. Remember BTL1
Create a copy constructor for class date (assume dd,mm,yy as its
6. Create BTL6
members).
7. How are virtual functions declared in C++? Analyze BTL4
8. Compose pure virtual functions? Where are they used? Create BTL6
9. When will the destructors be called? Is it implicit or explicit? Evaluate BTL5
10. What is a constructor? Is it mandatory to use constructors in a class? Evaluate BTL5
11. Define friend/static/const function with its rules. Remember BTL1
12. What is an operator function? Give an example. Understand BTL2
13. What is dynamic binding? Remember BTL1
14. Classify predefined C++ stream objects? Apply BTL3
Demonstrate a stream class which is required to create an output
15. Apply BTL3
stream?
16. Explain the various file stream classes needed for file manipulation. Analyze BTL4
17. Sketch and Show the I/O stream hierarchy? Apply BTL3
18. Why is it necessary to include the file iostream in all our programs? Understand BTL2
19. Name the two ways in which a file can be opened. Remember BTL1
20. Give the use of this Pointer. Understand BTL2
PART B (13 MARKS)
S.
QUESTIONS COMPETENCE LEVEL
No
Write a C++ program to perform 2D matrix operations as follows:
i) Define class MATRIX, use appropriate constructor(s). (3)
1. ii) Define methods for the following two matrix operations: Understand BTL2
Determinant and transpose. (5)
iii) Write a main program to discuss the use of the
constructor in MATRIX class and its methods. (5)
Write a C++ program as follows to perform arithmetic operations
on Rational numbers of type a/b, where a and b are integers.
(i) Define a class by Rational Number. (3)
(ii) Use operator overloaded methods for addition and
2. Remember BTL1
subtraction. (3)
(iii) Write a main program to demonstrate the use of this class
and its methods. (5)
(iv) Give a sample output. (2)

Write a C++ program for the following:


Rameshs basic salary is given input to the keyboard. His
dearness allowance is 40% of basic salary and house rent
3. Understand BTL2
allowance is 20% of basic salary. Write a program to calculate
his gross salary. Use constructors, Destructors and member
functions.

Construct and analyze a class by name 'Box with a constructor


method and volume method. Constructor initialized the length,
breath and height of the box objects. Volume method computes
4. Analyze BTL4
the volume of the box using the formula length * breath * height.
Create three box objects and compute their volume by declaring a
pointer to the box (Any Program).

Describe the rules of operator overloading with one example and


Write a C++ program to define overloaded constructor to
5. Remember BTL1
perform string initialization, string copy and string destruction.

Write an object oriented program in C++ that print a


6. factorial/Fibonacci series of a given number using a copy Apply BTL3
constructor and a destructor member function.
Write and explain a C++ program to create a list of
7. Evaluate BTL5
prime/Armstrong numbers between the two given limits.

Develop a function the computes and displays the area of a


rectangle and the area of a square. Declare this function as a friend
8. function in Rectangle and square classes and compute the area of Apply BTL3
a rectangle and square objects from the main function.(Any
Program)

Consider the TNEB Electricity bill generation problem. Define


9. suitable classes and objects. Write a program to implement the Create BTL6
application with near output format.

With suitable example, examine how function overloading and


10. Remember BTL1
operator overloading supports compile-time polymorphism

Explain the following


11. i) Various types of Constructors that are available in C++ (10) Analyze BTL4
ii) Polymorphism (3)
Discuss the following
i) Various types of polymorphism in C++ with suitable example
12. Understand BTL2
(7)
ii) Friend function with example (6)

i) Describe iterators with example (7)


13. Remember BTL1
ii) Describe this pointer in C++ with example (6)

i) Explain containers with example (8)


14. Analyze BTL4
ii) Explain static and const member function (5)

PART C (15 MARKS)


S.
QUESTIONS COMPETENCE LEVEL
No

1. Write and explain a C++ program to create Pascal triangle. Evaluate BTL5
Develop a function the computes and displays the area of a
Triangle and the area of a Circle. Declare this function as a friend
2. Apply BTL3
function in Triangle and Circle classes and compute the area of a
Triangle and Circle objects from the main function.(Any Program)

Consider the Toll Booth bill (for different classes of vehicles)


3. generation problem. Define suitable classes and objects. Write a Create BTL6
program to implement the application with near output format.

With suitable programming example, examine how + operator can


4. be used to perform integer addition/ string concatenation based on the Remember BTL1
operands

UNIT-3

UNIT III ADVANCED PROGRAMMING

Templates, Generic Programming, and STL-Inheritance-Exceptions-OOP Using C++.

PART A (2 MARKS)
S.
QUESTIONS COMPETENCE LEVEL
No
Construct the syntax of try catch- throw in exception handling in
1 Create BTL6
C++
2 Differentiate function template and class template Analyze BTL4
3 What are the manipulators available in C++? Remember BTL1
4 What is a hierarchy inheritance? Give an example Remember BTL1
5 Give any five functions used for file processing Understand BTL2
6 What is the use of templates? Understand BTL2
7 What are manipulators? How do you create a one? Analyze BTL4
8 Give any two examples of exceptions Understand BTL2
Why is it not possible to refer an exception declared within try
9 Apply BTL3
block outside try block?
10 Illustrate the exception handling mechanism Apply BTL3
List out any four containers supported by Standard Template
11 Remember BTL1
Library?
12 What is rethrowing an expression? Remember BTL1
13 What is an exception? Give any four examples of exception Understand BTL2
14 Examine virtual base class with an example Apply BTL3
15 Point out the reason templates used in the C++ Analyze BTL4
16 List the way of class template inheritance Remember BTL1
17 List the different types of inheritance Remember BTL1
18 Summarize the classes in the iostream. h Evaluate BTL5
19 Draw console stream class hierarchy Create BTL6
20 Explain file pointer and give its types Evaluate BTL5

PART B (13 MARKS)


S.
QUESTIONS COMPETENCE LEVEL
No
i) What is a template function? (2)
ii) Design and implement a template version functions min() and
1 Evaluate BTL5
max() for finding minimum and maximum values of a given set of
elements in list T represented by a seqList <T> object (11)
i) What is the significance of inheritance (3)
2 ii) Explain the various types of inheritance with a programming Create BTL6
example for each type (10)

Analyze the exception handling mechanism available in C++ with


3 Analyze BTL4
suitable examples

Write a program that demonstrates several exception types being


4 Apply BTL3
caught with the catch() exception handler

Write an object oriented program in C++ using a class template to


5 read any five parameterized data type such as float and integer, and Remember BTL1
print the average

6 Classify the components of Standard Template Library in detail Analyze BTL4


Explain the 4 functions
i) Seekg,
ii) Seekp,
7 iii) tellg, Understand BTL2
iv) tellp
used for setting pointers during file operation and (8)
show how they are derived from fstream class (5)
8 Describe about generic program in details Understand BTL2

Write a program to create a class STUDENT with data members


RollNo , Name, Course , Branch , Semester.
Store them in an array of objects.
Input the total number students if students are perform the
9 Remember BTL1
following:
(i) Sorted list of students in the ascending order of Name
(ii) Branch wise students list
(iii)Use inheritance concept

Write Short notes on


10 (i) Run time polymorphism (virtual function) (7) Remember BTL1
(ii) Pure virtual function (6)
Explain the following
11 i) User defined exceptions (7) Analyze BTL4
ii) System defined exceptions (6)
i) What is an access modifier? (2)
12 ii) Differentiate between private, protected and public access Understand BTL2
modifier with examples (11)
13 i) Describe OOP Language requirements (6) Remember BTL1
ii) Describe ADT in Non OOP Language (7)
What is a function template? (4)
14 Write a template function to sort arrays of float and int using bubble Apply BTL3
sort (9)

PART C (15 MARKS)


S.
QUESTIONS COMPETENCE LEVEL
No
i) What is a template function? (2)
ii) Design and implement a template version functions Asc() and
1 Des() for arranging a given set of elements in ascending and Evaluate BTL5
descending order. Element list T represented by a seqList <T>
object (13)
i) What is the significance of inheritance (4)
2 n Create BTL6
ii) Explain inheritance and write a program for Cr that uses
inheritance (11)
Analyze the exception handling mechanism available in C++ and
write a program that throw exception for wrong operands (in terms
3 Analyze BTL4
number of operands and type) for any operators/expression of your
choice
4 Write a program that demonstrates system defined exceptions Apply BTL3

UNIT-4

UNIT IV OVERVIEW OF JAVA


Data types, variables and arrays, operators, control statements, classes, objects, methods
Inheritance
PART A (2 MARKS)
S.
QUESTIONS COMPETENCE LEVEL
No
1. What is byte code? Mention its advantage. Remember BTL1
2. Give two examples for access modifier. Understand BTL2
Design a sample statement for parseInt( ) and give comments for the Create
3. BTL6
statement.
4. What is an abstract class? Remember BTL1
5. Define a wrapper class in java? Remember BTL1
6. Why is java language called as robust? Analyze BTL4
7. How does java make an executable file? Apply BTL3
8. Differentiate Interface and Abstract class? Analyze BTL4
9. What is an inner class? Remember BTL1
10. Examine the significance of Java Virtual Machine? Apply BTL1
11. How is garbage collection done in java? Apply BTL3
12. What is a token? List the various types of tokens supported by Java. Remember BTL1
In Java, can a class be defined inside a method? If so what rule
13. governs access to the variables of the enclosing method? If not, give Evaluate BTL5
reasons.
14. How does Java achieve platform independence? Apply BTL3
Distinguish between method overriding and method overloading in Analyze
15. BTL4
Java.
16. Criticize the type of class for which objects cannot be created? Evaluate BTL5
17. Compose the two ways of using Super/this Keyword? Create BTL6
18. How do you use final keyword in variable/function/class in java? Understand BTL2
19. How do you define an array with example? Understand BTL2
20. Describe Java Virtual Machine (JVM). Remember BTL2

PART B (13 MARKS)


S.
QUESTIONS COMPETENCE LEVEL
No
Write a java program to create two single dimensional arrays,
1. initialize them and add them; store the result in another array. Understand BTL2
Discuss its operation.
Write a menu-based java program that can calculate the area of a
2. triangle, circle or square, based on the users choice. Discuss its Understand BTL2
operation.
Describe the structure of a typical Java program and give the steps Remember
3. BTL1
to execute it.
Write a java class called student with name, Marks of 3 subjects
and total Marks. (5)
4. Write another class named calculate that gets the Marks of the Create BTL6
student and calculates the total Marks and displays the result (pass
or fail). (8)
Describe the three different types of inheritance with an example java Remember
5.
program for each.
BTL1

6. Write a java program to find the maximum number of the given array. Apply BTL3

7. Write a java to calculate and convert an Integer array to string. Apply BTL3

8. Write a simple java program to classify basic Calculator operations. Analyze BTL4

Write a java Program to evaluate the sum of the following series


9. Evaluate BTL5
1-2+3 -4+..+n

10. Discuss about benefits of abstract class. Remember BTL1


Explain the following
11. i) Method Overloading (8) Analyze BTL4
ii) Method Overriding (8)
Discuss the various types of operators in java and explain with Understand
12. BTL2
suitable examples
i) Describe function template in java with example (7) Remember
13. BTL1
ii) Describe class template in java with example (6)
14. Explain classes and objects in java with example Apply BTL4

PART C (15 MARKS)


S.
QUESTIONS COMPETENCE LEVEL
No
Write a java program to create two 2-dimensional arrays, initialize
1. them and multiply them; store the result in another array. Discuss its Understand BTL2
operation.
Write a menu-based java program that can perform ordinary Understand
2. BTL4
calculator operations. Explain its operation.
Write a java class called Employee with Name, Designation and
total Basic Pay. (5)
Write another class named calculate that gets the Basic Pay of the Create
3. BTL3
Employee and calculates the total Salary as per the formula
Net Salary= (Basic Pay + Allowances)-Deductions and displays the
Net Salary. (8)
Write a java Program to evaluate the sin series for a given angle in Evaluate
4. BTL5
degree and for n terms

UNIT-5

UNIT V EXCEPTION HANDLING

Packages and Interfaces, Exception handling, Multithreaded programming, Strings, Input /Output

PART A (2 MARKS)
S.
QUESTIONS COMPETENCE LEVEL
No
1. Define interface. State its use. Remember BTL1
2. What is thread? How does is it differ from a process? Understand BTL2
3. Under which context would you use final and finally? Analyze BTL4
4. Give one example on streams. Understand BTL2
5. List the advantage of using package s in Java Programming? Remember BTL1
6. What are the similarities between interfaces and classes in Java? Analyze BTL4
7. How do we set priorities for threads? Apply BTL3
What happens if an exception handler is not defined when Apply
8. BTL3
exception is thrown?
9. Explain the life cycle of thread. Evaluate BTL5
10. What are the two methods by which we may stop threads? Apply BTL3
11. What is an exception? Give any four examples of exception. Understand BTL2
12. What is multithreading? Remember BTL1
13. State threads Synchronization. Remember BTL1
14. Draw I/O Stream Hierarchy. Create BTL6
15. Compare String and String Buffer. Analyze BTL4
16. List the various string method. Remember BTL1
17. Express the various ways to import packages. Understand BTL2
18. Which method can be used for changing case of characters? Evaluate BTL5
19. Sketch the Exception Hierarchy. Create BTL6
20. How to create a user defined exception with example. Remember BTL1

PART B (13 MARKS)


S.
QUESTIONS COMPETENCE LEVEL
No
Write a java program to perform all string operations using the String
1. Create BTL6
Class. Explain with sample data.
2. Demonstrate exception handling in java with an example program. Apply BTL3
Summarize the following with examples from Java.
3. (i) Streams and IO (7) Evaluate BTL5
(ii) Java threads. (6)
i) What is a thread? (2)
4. Analyze BTL4
ii) How do you create threads and explain? (11)
5. Explain the concept of streams and its byte stream classes in detail. Analyze BTL4
i) Discuss how packages are used to resolve naming conflicts in java?
(4)
6. Understand BTL2
ii) With an example show to add classes to packages and how to
import packages in classes. (9)
i) What are interfaces? (2)
7. ii) Discuss with an example how multiple inheritances are Understand BTL2
implemented using interfaces. (11)
i) What is multithreading? (2)
8. ii) Explain the two methods of implementing threads with an Remember BTL1
example. (11)
9. Write a java program to implement nested Packages. Remember BTL1
10. Describe with an example the exceptional handling feature in Java. Remember BTL1
Explain the following Analyze
11. i) Java Input streams (6) BTL4
ii) Java Packages with its types (7)
12. Discuss Java Output streams with example Understand BTL2
i) What is multithreading? (2) Remember
13. BTL1
ii) Write a multithreaded program in java and explain (11)
Illustrate the use of try-catch clauses by sample statements of rare Apply BTL3
14.
type runtime error

PART C (15 MARKS)


S.
QUESTIONS COMPETENCE LEVEL
No
Write a java program to check whether the given string is Palindrome
1. Create BTL6
or not using the String Class. Explain with sample data.
2. Demonstrate multithreading in java with an example program. Apply BTL3
Summarize the following with examples from Java.
3. (i) Java Packages (6) Evaluate BTL5
(ii) Advantages of Java threads. (7)
i) What are interfaces? (2)
4. Analyze BTL4
ii) Explain interface in java with an example program? (13)

You might also like