SET6 Notes
SET6 Notes
Third Semester
(Regulations 2021)
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.
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.