Question Bank - 345 Mod
Question Bank - 345 Mod
Module-1
https://www.vtupulse.com/cplusplus-programs/solution-to-18
cs45-ooc-module-1-question-bank/
4. List and explain any four features of an object-oriented program. Jan.-19, Marks 5
7. What is a reference variable? Explain. Write a C++ program to swap two integer
values and display the values before and after swapping. Jul.-17, Marks 5
9. What is polymorphism? Write a C++ program using the overloaded function area to
find the area of a square, circle, and rectangle. Jul.-17, Marks 6
10. Define function overloading and Write a C++ program to find the areas of the circle
(PI * r * r), rectangle (l * b), and square (x * x) by getting the r, l, b, and x through the
keyboard and printing the areas on the console using the method area() by applying
the concept of function overloading. July 18, Marks 8.
11. What is Function Overloading? Write a C++ program to define three overloaded
functions to find the sum of two integers, the sum of two floating-point numbers, and
the sum of three integers. Jan.-19, Marks 7
14. Explain how one can bridge two classes using the friend function. Write a C++
program to find the sum of two numbers using the bridge friend function add().Jul.-17,
Marks 6
15. What are static members of a class? Write a C++ program to count the number of
objects created. Jul.-17, Marks 5
17. What is the inline function? Write a C++ program to find the maximum of two
numbers using the inline function. July-19, Marks 8
18. Define a Student class with the following measures: Data Members: RollNo, Name,
average marks Member function: to read the data, to print the data. Write a C++
program to read the data of 10 students and print the 10 students’ information.
July-17, Marks 5
19. How does namespace help in preventing pollution of the global namespace?
July-17, Jan.-18, Marks 4
21. Write a C++ program to get the employee details (empno, empname, bsalary
(initialized to 1000 by constructor) and allowance) of the Employee class through the
keyboard using the method GetData() and display them using the method DispData()
on the console in the format empno, empname, bsalary,allowance. VTU : July-18,
Marks 8
22. What is a constructor? List the different types of constructors and explain the
default constructor with an example. Jan.-18, Marks 6
23. What is a constructor? Mention its types. Explain parameterized constructor with
an example. Jan.-19, Marks 6
24. What is a constructor? Mention its type. Explain the parameterized constructor
with a suitable code. July-19, Marks 8
25. Write a C++ program to define an Employee class with the following Members:
Data Members: empid, emp salary Member Functions: to read a data and to print the
data. The program should use an array within the class to read 3 employee information
and print the 3 employee information.
Module-2
https://www.vtupulse.com/cplusplus-programs/solution-to-18
cs45-ooc-module-2-question-bank/
1. Write a C++ program to get the employee details (empno, empname, bsalary
(initialized to 1000 by constructor) and allowance) of the Employee class through
keyboard using the method GetData() and display them using the method DispData()
on the console in the format empno, empname, bsalary,allowance. VTU : July-18,
Marks 8
2. What is a constructor? List the different types of constructors and explain the
default constructor with an example. Jan.-18, Marks 6
4. What is a constructor? Mention its type. Explain the parameterized constructor with
a suitable code. July-19, Marks 8
5. Write a C++ program to define an Employee class with the following Members: Data
Members: empid, emp salary Member Functions: to read a data and to print the data.
The program should use an array within the class to read 3 employee information and
print the 3 employee information.
8. Define byte code. How does it help Java program(s) achieve portability? Jan.-19,
Marks 5
10. How “compile once and run anywhere” is implemented in JAVA? Discuss. July-17,
Marks 4
11. List and explain the Java buzzwords. July-17, 19, Jan.-19 Marks 8
13. Explain the structure of Java program and its keywords with an example. July-18
Marks 10
14. Write Java program to initialize and display different types of integer and floating
point variables. Jan.-18, Marks 6
15. Explain the operation of the following operators with example. Jan 18 Marks 6
16. With an example, explain in working of >> and >>> (unsigned right shift). Jan 19
Marks 4
17. List the different types of operators. Explain any three. July 19 Marks 8
18. Explain the concepts of arrays in Java with examples. Also, write a program that
creates and initializes a four integer elements array. Find the sum and average of its
values. July-17, Marks 8
19. How to declare two dimensional arrays in java? Explain with simple example.
Jan.-18, Marks 4
20. How arrays are defined in Java? Explain with an example. July-18, Marks 4
22. Write a Java program to find the factorial of a number ‘n’ using for loop. Jun.-18,
Marks 6
23. Write a java program to find the sum array elements. Jan.-18, Marks 5
24. Define type casting. Explain with an example. July 2017, Jan 19 Marks 5
25. Define type casting. Illustrate with an example. What is the mean by automatic
type conversion? Jan 18 Marks 6
28. Write a Java program to find the number of and the sum of all numbers greater
than 100 and less than 200 (inclusive both) which are divisible by 7.
Module-3
1. Can you overload the constructor and destructor? Justify with suitable program.
July-17, Marks 6
5. Elucidate the concept of inheritance and its classifications in Java with sketches.
July-18, Marks 8
7. Write short notes on the “super” keyword, with an example. July-19, Marks 4
10. Compare and contrast method overloading and method overriding with suitable
examples. July-17, Marks 6, Jan.-18, Marks 5, Jan.-19, Marks 4
11. Discuss the following terms with examples: i) super ii) final. Jan.-19, Marks 8
12. Define exception. Write a program that contains one method which will throw
IllegalAccessException and use proper exception handlers so that exception should be
printed. July-17, Marks 6
13. Give the basic form of an exception handling block. Jan.-18, Marks 8
15. Define exception. Explain the exception handling mechanism with an example.
Jan.-19, Marks 8
1. Define package. What are the steps involved in creating a user-defined package with
an example? July 2017, Marks 5.
3. Describe the various levels of access protection available and their implications.
Jan 2018, 2019, Marks 8.
4. Write a Java program to define an interface called Area which contains a method
called Compute() and calculate areas of the rectangle(I*b) and triangle(1/2*b*h) using
classes Rectangle and Triangle. July-18, Marks 8 – V
5. Briefly explain the role of the interface while implementing the multiple
inheritances. July 2017, Marks 6 – V
7. Elucidate the two ways of making a class threadable, with examples. July-18, Marks
8
8. What is the thread? Explain two ways of creating a thread in JAVA with an example.
Jan.-19, Marks 8
9. Explain the concepts of multithreading in Java. Explain the two ways of making
class threadable with examples. July-19, Marks 10
13. What is the need for synchronization? Explain with an example how
synchronization is implemented in JAVA. Jan.-19, Marks 8 )- V
15. Interfaces in Java Difference between Class and Interface Extend Interface
Implement Interface -V
16. Explain the role of synchronization with the Bounded buffer problem.
17. What are the differences between suspending and stopping the threads? July-17,
Marks 5
18. Define the concept of multithreading in Java and explain the different phases in
the life cycle of a thread, with a neat sketch. July-18, Marks 8
Module-5
1. Explain the delegation event model used to handle events in java with suitable
examples. July 17, 6M Jan 18, 8M
2. Write a short note on Event class and explain with syntax. July 19, 8M
3. Explain the delegation event model used to handle events in JAVA. What are events,
event listener, and event sources? Jan.-19, Marks 6
4. Write short notes on the Event Listener interface and explain any two interfaces with
syntax. July-19, Marks 8
5. Describe the delegation event model and explain what happens internally at a button
click. July-18, Marks 8
6. Explain key event and mouse event class. Jan. 18, Marks 6
9. Explain the Adapter class and Inner classes with examples. Jan.-19, Marks 6
10. How inner classes are used in Java? Explain. July-19, Marks 4
Java Applets
2. What are applets? Explain different stages in the lifecycle of an applet. July-17,
Marks 5
3. What is an applet? Explain five main methods of the applet. Jan.-18, Marks 8
6. Design an applet to display three buttons “Red”, “green”, and “blue”. The color of the
background changes according to the button pressed by the user.
7. Write a program using an applet that will print “key pressed” on the status window
when you press the key. “Key released on the status window when you release the key
and when you type the characters it should print “Hello” at coordinates (50,50) on the
applet. Jan.-19, Marks 8
8. Develop an applet that receives two numerical values as input from the user and
then displays the sum of these numbers on the screen.
9. What are the two types of applets? Explain the skeleton of an apple. Enlist applet
tags. July-17, Marks 6
10. What is an applet? Explain the skeleton of an applet. Enlist applet tags. Jan.-19,
Marks 8
11. Explain the applet architecture and demonstrate how to pass parameters for font
size and font name in applets. July-17, Marks 5
14. Write a Java program to play an audio file using Applets. July-18, Marks 8
Java Swings
4. Explain briefly the components and containers used in swings. July-17, Marks 5
7. Explain the following with an example for each and syntax: JLabel. Jan.-19, Marks 3
10. Explain the following with an example for each and syntax: JTextfield. Jan.-19,
Marks 3
11. Explain the following with a suitable code: JTextField. July-19, Marks 5
12. Create a swing applet that has two buttons named beta and gamma. When either
of the buttons is pressed, it should display “beta pressed” and “gamma pressed”
respectively. Jan.-18, Marks 8
14. Explain the following with an example for each and syntax: JButton. Jan.-19,
Marks 3
15. Explain the following with a suitable code: JList. July-19, Marks 5
16. Write a swing program for displaying any one of the options C, C++, Java, PHP
through a selection of Combobox by clicking the show button. June-18, Marks 8
17. Explain the following with an example for each and syntax: JComboBox Jan.-19,
Marks 3
18. Write steps to create JTable, also write a program to demonstrate the same.
July-17, Marks 5
19. Explain the following with a suitable code: JTable July-19, Marks 5