Java Lab Manual 5 SEM
Java Lab Manual 5 SEM
LAB MANUAL
5) • Write a program that prompts the user to enter a letter and check
whether a letter is a vowel or constant.
• Assume a vehicle plate number consists of three uppercase letters
followed by four digits. Write a program to generate a plate LAB 5
number.
• Write a program that reads an integer and displays all its smallest
factors in increasing order. For example if input number is 120,
the output should be as follows:2,2,2,3,5.
6) • Write a method with following method header. public static int
gcd(intnum1,intnum2)
Write a program that prompts the user to enter two integers and
compute the gcd of two integers.
LAB 6
• Write a java program to display the employee details using
scanner class
7)
8)
10)
• Write a program that creates an Array List and adds a Loan object
, a Date object , a string, and a Circle object to the list, and use a
loop to display all elements in the list by invoking the object’s to
String() method.
LAB 10
• Write the bin2Dec (string binary String) method to convert a
binary string into a decimal number. Implement the bin2Dec
method to throw a Number Format Exception if the string is not
a binary string.
11)
12)
• Write a program that displays the color of a circle as red when
the mouse button is pressed and as blue when the mouse button
is released.
LAB 12
• Write a GUI program that use button to move the message to the
left and right and use the radio button to change the color for the
message displayed.
13)
14)
• Write a test program that prompts the user to enter an integer and
display its product.
LAB 14
• Write a generic method that returns the minimum elements in a
two dimensional array.
15)
• Define MY Priority Queue class that extends Priority Queue to
implement the Cloneable interface and implement the clone()
method to clone a priority queue.
LAB 15
• Write a program that reads words from a text file and displays all
the nonduplicate words in descending order. The text file is
passed as a command-line argument.