0% found this document useful (0 votes)
30 views

Set4 Notes

The document provides instructions for a practical exam on object oriented programming lab. It lists 20 programming questions covering topics like classes, inheritance, polymorphism, exceptions, files, threads and GUI components.

Uploaded by

Vijaya Lakshmi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Set4 Notes

The document provides instructions for a practical exam on object oriented programming lab. It lists 20 programming questions covering topics like classes, inheritance, polymorphism, exceptions, files, threads and GUI components.

Uploaded by

Vijaya Lakshmi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

B.E / B.Tech.

PRACTICAL END SEMESTER EXAMINATIONS, NOVEMBER/DECEMBER 2022

Third Semester

CS3381 – OBJECT ORIENTED PROGRAMMING LABORATORY

(Regulations 2021)

Time : 3 Hours Answer any one Question Max. Marks 100

Aim/Principle/Apparatus Tabulation/Circuit/ Calculation Viva- Record Total


required/Procedure Program/Drawing & Results Voce
20 30 30 10 10 100

1. Write a program to create a room class, the attributes of this class is room no, room type,
room area and AC machine. In this class the member functions are set data and display
data.

2. a) Write a program to demonstrate static variables, methods, and blocks.

b) Write a program for reuse class. For this program use the above ‘room class’ program

3. a) Write a program to give the example for method overriding concepts.

b) Write a program to give the example for ‘super’ keyword.

4. Write a program to create a class named shape. In this class we have three sub classes
circle, triangle and square each class has two member function named draw () and erase
(). Create these using polymorphism concepts.

5. Create an outer class with a function display, again create another class inside the outer
class named inner with a function called display and call the two functions in the main
class.

6. Create class box and box3d. box3d is extended class of box. The above two classes going
to pull fill following requirement

• Include constructor.
• set value of length, breadth, height
• Find out area and volume.
Note: Base class and sub classes have respective methods and instance variables

Page 1 of 3
7. Write a program for example of multiple catch statements occurring in a program.

8. Write a program to illustrate usage of try/catch with finally clause

9. Write a program for creation of user defined exception.

10. Write a program to rename the given file, after renaming the file delete the renamed file.
(Accept the file name using command line arguments.)

11. Write a program to create a file and write data into it using the methods OutputStream
class.

12. Write a program to get the input from the user and store it into file. Using Reader and
Writer file

13. Create a multithreaded program by creating a subclass of Thread and then creating,
initializing, and staring two Thread objects from your class. The threads will execute
concurrently and display Java is hot, aromatic, and invigorating to the console window.

14. Develop a java application with Employee class with Emp_name, Emp_id, Address,
Mail_id, Mobile_no as members. Inherit the classes, Programmer, Assistant Professor,
Associate Professor and Professor from employee class. Add Basic Pay (BP) as the
member of all the inherited classes with 97% of BP as DA, 10 % of BP as HRA, 12% of BP
as PF, 0.1% of BP for staff club fund. Generate pay slips for the employees with their gross
and net salary.

15. Write a Java program that reads a file name from the user, displays information about
whether the file exists, whether the file is readable, or writable, the type of file and the
length of the file in bytes.

16. Write a program to Check Prime Number using Interface.

17. Write a program to exhibit simple inheritance, multilevel inheritance and hybrid inheritance
concepts.

18. a) Write a program to create a dialogbox and menu.


b) Write a program to create a grid layout control.

Page 2 of 3
19. a) Write a program to create a border layout control.
b) Write a program to create a padding layout control.

20. Create an outer class with a function display, again create another class inside the outer
class named inner with a function called display and call the two functions in the main
class.

Page 3 of 3

You might also like