1010206202_Object Oriented Programming using Java (P)
1010206202_Object Oriented Programming using Java (P)
Bachelor of Engineering
B.Tech.
Semester II
Object Oriented Programming using Java -
Practical
Syllabus version:1.00
BHAGWAN MAHAVIR UNIVERSITY
Department: Computer Engineering
Bachelor of Engineering
List of Practical:
Bachelor of Engineering
Write a program for calculator to accept an expression as a string in which the operands
13 and operator are separated by zero or more spaces.
For ex: 3+4 and 3 + 4 are acceptable expressions.
Write a program that creates an Array List and adds a Loan object, a Date object, a string,
14 and aCircle object to the list, and use a loop to display all elements in the list by invoking
the object’s to String() method.
Write the bin2Dec (string binary String) method to convert a binary string into a decimal
15 number. Implement the bin2Dec method to throw a NumberFormatException if the string
is not a binarystring.
Write a program that prompts the user to enter a decimal number and displays the number
in a fraction.
16
Hint: Read the decimal number as a string, extract the integer part and fractional part from
thestring.
Write a program that displays a tic-tac-toe board. A cell may be X, O, or empty. What to
17 display ateach cell is randomly decided. The X and O are images in the files X.gif and
O.gif.
18 Write a program that moves a circle up, down, left or right using arrowkeys.
Write a program that displays the color of a circle as red when the mouse button is pressed
19
and asblue when the mouse button is released.
Write a GUI program that use button to move the message to the left and right and use the
20
radio button to change the color for the message displayed.
Write a program to create a file name 123.txt, if it does not exist. Append a new data to it
21 if it already exists. write 150 integers created randomly into the file using Text I/O. Integers
are separated by space.
Write a recursive method that returns the smallest integer in an array. Write a test program
22
that prompts the user to enter an integer and display its product.
23 Write a generic method that returns the minimum elements in a two-dimensional array.
Define MY Priority Queue class that extends Priority Queue to implement the Cloneable
24
interface and implement the clone() method to clone a priority queue.
Write a program that reads words from a text file and displays all the nonduplicate words
25
in descending order. The text file is passed as a command-line argument.
Major Equipment:
*******************************************************************