Vous êtes sur la page 1sur 2

EX: NO. 1 Rational number class in Java Step 8: Stop the program.

DATE: RESULT:

AIM: Thus the program to implement Lisp-like list in Java was


executed and the output was verified successfully.
To develop a Rational number class in Java, using JavaDoc
comments for documentation. The implementation should use efficient EX: NO. 4 Design a Java interface for ADT Stack
representation for a rational number, i.e. (500 / 1000) should be
represented as (½). DATE:

ALGORITHM: AIM:

Step 1: Start the program. To design a Java interface for ADT Stack and to develop two
Step 2: Define a class with two integer data fields’ numerator and different classes that implements this interface, one using array and the
denominator. other using linked-list.
Step 3: Define a constructor to initialize the rational number and to
simplify it. ALGORITHM:
Step 4: Define methods to perform the basic arithmetic operations such
as addition, subtraction, multiplication, division and reciprocal. Step 1: Start the program.
Step 5: Call the appropriate functions with the corresponding arguments Step 2: Design an interface for Stack ADT with functions push, pop and
and display the result. display.
Step 6: Stop the program. Step 3: Define a class to implement the stack using array.
Step 4: Define the functions of the interface accordingly and handle the
RESULT: stack overflow and underflow exceptions.
Step 5: Define a class to implement the stack using linked list.
Thus the program to develop a rational number class with Step 6: Define the functions of the interface accordingly and handle the
methods to perform the basic arithmetic operations was executed and exceptions.
the output was verified successfully. Step 7: Stop the program.

RESULT:
EX: NO. 2 Date class in Java
Thus the program to implement Stack ADT using array and
DATE: linked list was executed and the output was verified successfully.

AIM: EX: NO. 5 Design a Vehicle class hierarchy in Java

To develop Date class in Java similar to the one available in java.util DATE:
package. Use JavaDoc comments.
AIM:
ALGORITHM:
To design a Vehicle class hierarchy in Java and to demonstrate
Step 1: Start the program. polymorphism.
Step 2: Define an object today to the Date class and store the current
date in that object. ALGORITHM:
Step 3: Change the Date Format to Short, Long and Medium and display
the date. Step 1: Start the program.
Step 4: Convert the Date to String and print it. Step 2: Define a class Vehicle with fields register no. and model.
Step 5: Stop the program. Step 3: Define a method display which displays all the data fields.
Step 4: Define the classes namely Twowheeler, Threewheeler and
RESULT: Fourwheeler as subclasses of Vehicle class.
Step 5: These subclasses defines a method named display that overrides
Thus the program to develop a Date class was executed and the super class method.
the output was verified successfully. Step 6: Create objects for the subclasses and call the appropriate
methods.
EX: NO. 3 Lisp-like list in Java Step 7: Stop the program.

DATE: RESULT:

AIM: Thus the program to design vehicle class hierarchy and to


demonstrate polymorphism was executed and the output was verified
To implement Lisp-like list in Java. To perform the basic successfully
operations such as 'car', 'cdr', and 'cons'.
EX: NO. 6 Random Generation of objects
ALGORITHM:
DATE:
Step 1: Start the program.
Step 2: Create a class LispCommands with a list in it. AIM:
Step 3: Define a function parse to write the elements into the list.
Step 4: Define a function car to return the leading element of the list. . To design classes namely Currency, Rupee, and Dollar. To
Step 5: Define a function cdr to return the list starting from the second write a program that randomly generates Rupee and Dollar objects and
element. writes them into a file using object serialization. To write another
Step 6: Define a function cons which adds an element to the front of the program to read that file, and to convert to Rupee if it reads a Dollar,
list. while leave the value as it is if it reads a Rupee.
Step 7: Call the respective functions with the appropriate arguments.
ALGORITHM: RESULT:

Step 1: Start the programs. Thus the program to print the prime numbers in the Fibonacci
Step 2: Define a class Currency as an abstract class with abstract series using multithreading was executed and the output was verified
methods. successfully.
Step 3: Define the classes Rupee and Dollar as subclasses of Currency.
Step 4: Define the abstract methods of the super class accordingly in EXP: NO. 9 Simple OPAC system for library
each subclass.
Step 5: The dollar value is converted to equivalent rupee value within a DATE:
method of Dollar class.
Step 6: Define a class StoreCurrency that randomly generates objects of AIM:
Rupee and Dollar classes.
Step 7: These objects are written into a file named currency using object To develop a simple OPAC system for library using event-
serialization. driven and concurrent programming paradigms of Java. JDBC is used to
Step 8: Define a class ReadCurrency that reads the objects from the file connect to a back-end database.
currency, and displays them.
Step 9: Stop the programs. ALGORITHM:

RESULT: Step 1: Start the program.


Step 2: Design the front end for the library system.
Thus the program to generate objects randomly and to write Step 3: Connect the front end with the database at the backend using
them into a file using object serialization was executed. The file was JDBC.
read and the required rupee-dollar conversions were performed and the Step 4: Design the front end such that it accepts the inputs from the user
output was verified successfully. and inserts the records into the database.
Step 5: Display the contents of the database at the front end.
EXP: No. 7 Calculator in Java Step 6: Suspend the established connections.
Step 7: Stop the program.
DATE:
RESULT:
AIM:
Thus the program to design a simple OPAC system for library
To design a calculator using event-driven programming was executed and the output was verified successfully.
paradigm of Java.
EXP: NO. 10 Multithreaded Echo Server and Client
ALGORITHM:
DATE:
Step 1: Start the program.
Step 2: Create a frame for the calculator and include the swing AIM:
components such as buttons and text field as required in it.
Step 3: Layouts such as Border Layout and Grid Layout are used to To develop a multithreaded echo server and a corresponding
align the components as per the requirements of the calculator. client.
Step 4: Redefine the actionPerformed() method in the ActionListener
interface to perform the appropriate operations when the buttons are ALGORITHM:
pressed.
Step 5: Provide mechanisms to handle the Number Format exceptions Step 1: Start the program.
that may occur. Step 2: Create a Socket at the Server side.
Step 6: Stop the program. Step 3: Design the server such that it responds to each client using a
separate thread.
RESULT: Step 4: The server receives the data sent by the client and echoes those
data.
Thus the program to design a calculator was executed and the Step 5: Provide the necessary exception handling mechanisms at the
output was verified successfully. server.
Step 6: Create a Socket at the client side.
EXP: NO. 8 Multithreading in Java Step 7: Get the host name from the user.
Step 8: Establish a connection between the server and the client.
DATE: Step 9: Transmit the data from the client side to the server.
Step 10: Provide the necessary exception handling mechanisms at the
AIM: client.
Step 11: Stop the program.
To write a program in Java that prints all the prime numbers in
the Fibonacci series below 10000 using multithreading. RESULT:

ALGORITHM: Thus the program to develop a multithreaded echo server and


client was executed and the output was verified successfully.
Step 1: Start the program.
Step 2: Create a thread called Prime Thread that stores all the prime
numbers below 10000.
Step 3: Create another thread called Fibonacci Thread that stores the
elements of the Fibonacci series below 10000.
Step 4: Prime Thread and Fibonacci Thread are assigned a higher
priority than the main thread of the program.
Step 5: The main thread reads the values stored by both the threads,
checks for the common elements and prints them.
Step 6: Stop the program.

Vous aimerez peut-être aussi