Java End Semester Lab Questions
Java End Semester Lab Questions
The user enters two numbers in the text fields, Num1 and Num2. The Viva Total
division of Num1 and Num2 is displayed in the Result field when the Divide 10
button is clicked. If Num1 or Num2 were not an integer, the program would
throw a NumberFormatException. If Num2 were Zero, the program would
throw an Arithmetic Exception Display the exception in a message dialog
box
2. Develop an Applet that receives an integer in one text field & compute its
factorial value & returns it in another text filed when the button “Compute” is
clicked
Program1 Program 2
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
1. Write a Java program that reads a file name from the user, and then
displays information about whether the file exists, whether the file is readable, Viva Total
whether the file is writable, the type of file and the length of the file in bytes. 10
TOTAL
TOTAL
1.Write a Java Program to create an abstract class named Shape that contains
two integers and an empty method named print Area(). Provide three classes Total
named Rectangle, Triangle and Circle such that each one of the classes Viva
10
extends the class Shape. Each one of the classes contains only the method
print Area () that prints the area of the given shape.
2.Write a java program that simulates a traffic light. The program lets the user
select one of three lights: red, yellow, or green with radio buttons. On
selecting a button, an appropriate message with “stop” or “ready” or “go”
should appear above the buttons in a selected color. Initially there is no
message shown.
Program1 Program 2
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
Program1 Program 2
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
1.Write a java program to create an abstract class named Shape that contains
two integers and an empty method named printArea(). Provide three classes Total
named Rectangle, Triangle and Circle such that each one of the classes Viva
10
extends the class Shape. Each one of the classes contain only the method
printArea( ) that prints the area of the given shape.
2.Write a java program to implement stack ADT.
Program1 Program 2
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
Write a Java Program to create an abstract class named Shape that contains
two integers and an empty method named print Area(). Provide three classes Total
named Rectangle, Triangle and Circle such that each one of the classes Viva
extends the class Shape. Each one of the classes contains only the method 10
print Area () that prints the area of the given shape.
2. Write a Java program that works as a simple calculator. Use a grid layout to
arrange buttons for the digits and for the +, -,*, % operations. Add a text field
to display the result. Handle any possible exceptions like divide by zero. .
Program1 Program 2
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
1.Write a Java Program to create an abstract class named Shape that contains
two integers and an empty method named print Area(). Provide three classes Total
named Rectangle, Triangle and Circle such that each one of the classes Viva
10
extends the class Shape. Each one of the classes contains only the method
print Area () that prints the area of the given shape.
2.Write a Java program that handles all mouse events and shows the event
name at the center of the window when a mouse event is fired. (Use adapter
classes).
Program1 Program 2
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
1. Write a program that creates a user interface to perform integer divisions.
The user enters two numbers in the textfields, Num1 and Num2. The division Total
of Num1 and Num2 is displayed in the Result field when the Divide button is Viva
10
clicked. If Num1 or Num2 were not an integer, the program would throw
NumberFormatException. If Num2 were Zero, the program would throw an
ArithmeticException.Display The exception in a message dialog box
2. Write a Java program that works as a simple calculator. Use a grid layout to
arrange buttons for the digits and for the +, -,*, % operations. Add a text field
to display the result. Handle any possible exceptions like divide by zero.
Program1 Program 2
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
Program1 Program 2
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
Write a Java program that handles all mouse events 40-42 and shows the event
name at the center of the window when a mouse event is fired. (Use adapter Total
classes). Viva
Write a Java program that works as a simple calculator. Use a grid layout to arrange 10
buttons for the digits and for the +, -,*, % operations. Add a text field to display the
result. Handle any possible exceptions like divide by zero.
Program1 Program 2
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
Write a Java program that handles all mouse events and shows the event name
at the center of the window when a mouse event is fired. (Use adapter Total
classes). Viva
Write a java applet program to perform basic arithmetic calculations 10
Program1 Program 2
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
Program1 Program 2 10
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
Program1 Program 2
10
Aim & Programs(25) Execution & Aim & Programs(25) Execution &
Algorithms(10) Result (10) Algorithms(10) Result (10)
TOTAL
Program1 Program 2
10
Aim & Programs Execution Aim & Programs Execution
Algorithms (25) & Result Algorithms (25) & Result
(10) (10) (10) (10)
TOTAL