Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
6 views

INTERNAL 2 Java

Uploaded by

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

INTERNAL 2 Java

Uploaded by

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

SET-1

1.Write a Java program that works as a simple calculator. Use a grid layout to arrange
buttonsfor the digits and for the +, -, *, % operations. Add a text field to display the
result. Handleany possible exceptions like divided by zero.

2.Write a Java program for the following: Create a doubly linked listof elements.
Delete a given element from the above list. Display the contents of the list after
deletion.

3.a) Develop an applet in Java that displays a simple message.

b) Develop an applet in Java that receives an integer in one text field, and computes
its factorial Value and returns it in another text field, when the button named
“Compute” is clicked.

SET-2
1.Write a Java program that simulates a traffic light. The program lets the user select
one ofthree lights: red, yellow, or green with radio buttons. On selecting a button, an
appropriatemessage with “Stop” or “Ready” or “Go” should appear above the buttons
in selected color.Initially, there is no message shown.

2.Write a Java program to list all the files in a directory including the files present in
allits subdirectories.

3.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 named
Rectangle, Triangle, and Circle such that each one of the classes extends the class
Shape. Each one of the classes contains only the method print Area () that prints the
area of the given shape.

SET-3
1.Suppose that a table named Table.txt is stored in a text file. The first line in the file is the
header, and the remaining lines correspond to rows in the table. The elements are separatedby
commas. Write a java program to display the table using Labels in Grid Layout

2.Write a Java program that simulates a traffic light. The program lets the user select
one ofthree lights: red, yellow, or green with radio buttons. On selecting a button, an
appropriatemessage with “Stop” or “Ready” or “Go” should appear above the buttons
in selected color.Initially, there is no message shown.
3.Write a Java program for the following: Create a doubly linked list of elements.
Delete a given element from the above list. Display the contents of the list after
deletion.

SET-4
1.Write a Java program that loads names and phone numbers from a text file where the datais
organized as one line per record and each field in a record are separated by a tab (\t). Ittakes a
name or phone number as input and prints the corresponding other value from the hash table
(hint: use hash tables).

2. Write a Java program to list all the files in a directory including the files present
in allits subdirectories.

3.Write a Java program that handles all mouse events and shows the event name at the
centerof the window when a mouse event is fired (Use Adapter classes).

You might also like