Professional Documents
Culture Documents
Coimbatore
DEPARTMENT OF INFORMATION TECHNOLOGY
IT 302- JAVA PROGRAMMING
TUTORIAL PROBLEMS
Tutorial - #1
1. Print each of the following patterns. Use one System.out.println(...) statement for each line of
outputs.
a. * * * * *
***** *****
b. * * * * * *
* * *
c. * * * * *
*
*
* *
d. * * * * * *
*
**
e. * * * * *
*****
*
f. (a)
(b)
(c)
2. The parameter weekday is true if it is a weekday, and the parameter vacation is true if we
are on vacation. We sleep in if it is not a weekday or we're on vacation. Return true if we
sleep in.
Q-2 Given two int values, return their sum. Unless the two values are the same, then
return double their sum.
3.
Q-3 Given an int n, return the absolute difference between n and 21, except return double
the absolute
category
15.0 to 16.0
severely underweight
16.1 to 18.4
underweight
18.5 to 24.9
normal weight
25.0 to 29.9
overweight
30.0 to 34.9
moderately obese
35.0 to 39.9
severely obese
40.0 and up
11. Create an abstract class Person. Define 2 classes Employee and Worker from it. Use
Proper method to accept and display the details for the same. The fieldsof Employee are
Emp_no, Emp_name, address. Similar fields for worker are name and working hours.
12. Create an Interface called cineHall with methods availability () and cost (). Create class
named Booking which implements the interface cineHall. Create another class called
ClientBooking which calls the functions of Booking class. Create a proxy class called
proxyBooking to exhibit the ability of proxies in accessing the booking class
Tutorial # 9 Threads
20. Create thread to perform multiplication table.
Tutorial # 10 Thread Communication
21. Create a gui based chat program using threads
Tutorial # 12 Applets
24. Create applet to and display a banner in it
25. Create an applet draw a smiley on it