[go: up one dir, main page]

0% found this document useful (0 votes)
45 views3 pages

SET6 Notes

The document outlines instructions for a practical exam on Object Oriented Programming Laboratory. It provides 15 questions on Java programming concepts like inheritance, abstraction, interfaces, exceptions and multithreading. Students must answer any one question demonstrating their coding, compilation, output and knowledge during viva voce. The exam aims to evaluate various OOP concepts through practical implementation.

Uploaded by

Vijaya Lakshmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views3 pages

SET6 Notes

The document outlines instructions for a practical exam on Object Oriented Programming Laboratory. It provides 15 questions on Java programming concepts like inheritance, abstraction, interfaces, exceptions and multithreading. Students must answer any one question demonstrating their coding, compilation, output and knowledge during viva voce. The exam aims to evaluate various OOP concepts through practical implementation.

Uploaded by

Vijaya Lakshmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
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 & Algorithm Coding Compilation & Output Viva-Voce Record Total
20 30 30 10 10 100

1. Write an application in Java that prompts the user for the radius of a circle and uses a
method called circleArea to calculate the area of the circle and uses a method
circlePerimeter to calculate the perimeter of the circle.

2. Write an application in Java to create a super class Employee with information first
name & last name and methods getFirstName(), getLastName() derive the sub-
classes ContractEmployee and RegularEmployee with the information about
department, designation & method displayFullName() , getDepartment(), getDesig() to
print the salary and to set department name & designation of the corresponding sub-
class objects respectively.

3. Write an application in Java to create a super class Vehicle with information vehicle
number,insurance number,color and methods getConsumption()
displayConsumption(). Derive the sub-classes TwoWheeler and FourWheeler with
method maintenance() and average() to print the maintenance and average of vehicle.

4. Using Java create an abstract class Shape which calculate the area and volume of 2-d
and 3-d shapes with methods getArea() and getVolume(). Reuse this class to
calculate the area and volume of square ,circle ,cube and sphere.

5. In Java, create an abstract class Employee with methods getAmount() which displays
the amount paid to employee. Reuse this class to calculate the amount to be paid to
WeeklyEmployeed and HourlyEmployee according to no. of hours and total hours for
HourlyEmployee and no. of weeks and total weeks for WeeklyEmployee.

6. Create an Interface Vehicle with method getColor(),getNumber(), getConsumption()


calculate the fuel consumed, name and color for TwoWheeler and Four Wheeler By
implementing interface Vehicle.

7. Create an Interface StudentFee with method


getAmount(),getFirstName(),getLastName(), getAddress(), getContact(). Calculate the
amount paid by the Hostler and NonHostler student by implementing interface Student
Fee.

8. Write a Java program to create package called dept. Create four classes as CSE,
ECE, ME and CE add methods in each class which can display subject names of your
respect year. access this package classes from main class.

9. Create a class First (With display()), Second (With show()) in one package (myp),
create a class Third (With show()) in second package (mys). Create a class Test
(main()) & call all the methods in different classes.

10. Write a Java program to implement i) Null pointer exception, ii) String Index Out Of
Bounds Exception iii) FileNotFound and iv) InputMismatch Exception.

11. Create a class to handle a user defined exception (Name: Your preferred name), to
check if user can attend the university exam. If the user says he/she is tested corona
positive, user is not eligible to attend the exam. If the user says he/she is tested
corona negative, user is eligible to attend the exam.

12. Create an abstract class Eatable with an abstract method eat(), Create a child class
Fruit (Make it as abstract) add abstract method taste(), Create a child class to Fruit as
nameofFruit (class name) and call the methods eat, taste in a test class.
13. Develop a Java program for generating three threads to perform the following
Operations: i) Accept ‘N’ numbers ii) Print the greatest number and iii)Print the
smallest number.

14. Write a Java program to rethrow an exception – Define methods one() & two().
Method two() should initially throw an exception. Method one() should call two(), catch
the exception and rethrow it Call one() from main() and catch the rethrown.

15. Create an Interface payable with method getAmount ().Calculate the amount to be
paid to Invoice and Employee by implementing Interface.

You might also like