Question: Q . 1 . SET A Write a program to create a class called Divisors. Divisors has a method ( printdivisors ) to print all

Q.1. SET A
Write a program to create a class called Divisors. Divisors has a
method(printdivisors) to print all divisors for a given number. Write a Java program
to create three threads and all of them share same object of Divisors class.
Thread 1 has to print divisors of 20.
Thread 2 has to print divisors of 40.
Thread 3 has to print divisors of 60.
Please ensure that thread outputs are overlapped while printing the divisors using
two thread synchronization approaches (method and block level)
(8 Marks)
Q 2. SET A
A Shell Company Razen is recruiting the workers for daily wages. To recruit them,
the company consider only the age. The valid age to work in the company is between
18 to 58. You are asked to create a code in Java for recruiting the employees. The
code should display "Permitted to work at Shell!!!" if the age is between 18 to 58.
Otherwise it has to throw your own exception class (InvalidAgeException) object
displaying "Not Permitted to work at Shell!!!".
(8 Marks)
Q 3. SET A
Assume that a file named "Employee.dat" contains 50 Employee records . Each
employee record contains Empld,EmpName, Designation and NetSalary. Write a
Java program to read an Employee Id and display the details of the Employee
(8 Marks)
Q 4. SET A
Assume that a linked list contains 'n' Strings. Write a Java program to read a
character C and count the number of strings that has the character C in the
Middle.
(8 Marks)
Q 5. SET A
For the upcoming examination, a student has two subjects (Subject 1 and Subject 2).
A student can prepare any of the subjects by creating an instance for the
corresponding subject class. He / She may learn the subjects more one than time in
a day. Write a Java program to display which of these courses are learned more on a
particular day.
Q . 1 . SET A Write a program to create a class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!