OOPJ Practical List
OOPJ Practical List
Semester V
2150704
Madonna Lamin
Practical List
SNo. Program Proposed Completed Remarks
Date Date
1 Write a Java program to print the string 28.06.2019
literal “Hello World!!!”
(b) (The Fan class) Design a class named Fan to represent a fan. The class
contains:
■ Three constants named SLOW, MEDIUM, and FAST with values 1, 2,
and 3 to denote the fan speed.
■ A private int data field named speed that specifies the speed of the fan
(default SLOW).
■ A private boolean data field named on that specifies whether the fan is on
(default false).
■ A private double data field named radius that specifies the radius of the
fan (default 5).
■ A string data field named color that specifies the color of the fan (default
blue).
■ The accessor and mutator methods for all four data fields.
■ A no-arg constructor that creates a default fan.
■ A method named toString() that returns a string description for the fan. If
the fan is on, the method returns the fan speed, color, and radius in one
combined string. If the fan is not on, the method returns fan color and radius
along with the string “fan is off” in one combined string.
Draw the UML diagram for the class. Implement the class. Write a test
program that creates two Fan objects. Assign maximum speed, radius 10,
color yellow, and turn it on to the first object. Assign medium speed, radius
5, color blue, and turn it off to the second object. Display the objects by
invoking their toString method.
SET 5-Strings
SNo. Program Proposed Completed Remarks
Date Date
1 (Counting Each Letter in a String). Write a 23.8.2019
program that prompts the user to enter a
string and counts the number of
occurrences of each letter in the string
regardless of case.
SET 9-MultiThreading
SNo. Program Proposed Completed Remarks
Date Date
1 Write an application that creates and 4.10.2019
starts three threads. Each thread is
instantiated from the same class. It
executes a loop with 10 iterations.
Each iteration displays string
"HELLO", sleeps for 300
milliseconds. The application waits
for all the threads to complete &
displays the message "Good Bye...".
SET 10- UML DIAGRAMS
[F] A drawin
4. Prepare a state diagram for an interactive diagram editor for selecting and
dragging objects
5. Prepare a use case diagram and sequence diagram for a computer email
system
delivered item. The total amount should be subject to tax and service charge
of 18% for group of six and more. For smaller groups there should be a
blank entry. Any coupons or gift certificatessubmitted by the customer
should be subtracted