aim algorithm for oops manuval
aim algorithm for oops manuval
No:1A
IMPLEMENTATION OF SEQUENTIAL
Date:
SEARCH
Aim:
Aim is to write a program in java to solve problems by using
sequential search.
Algorithm:
1. Read the search element from the user
2. Compare, the search element with the first element in the list.
Algorithm:
3. Compare, the search element with the middle element in the sorted
list.
5. If both are not matching, then check whether the search element is
smaller or larger than middle element.
8. Repeat the same process until we find the search element in the list
or until sublist contains only one element.
Ex. No:1C IMPLEMENTATION OF QUADRATIC
Date: SORTING ALGORITHMS (SELECTION,
INSERTION)
Aim:
To write a java program for implementation of quadratic sorting
algorithms (selection,insertion)
Algorithm:
Selection sort:
1. Set the first element as minimum.
2. Compare minimum with the second element. If the second
element is smaller than minimum, assign the second
element as minimum.
3. Compare minimum with the third element. Again, if the
third element is smaller, then assign minimum to the third
element otherwise do nothing. The process goes on until
the last
4. After each iteration , minimum is placed in the front of the
unsorted list element.
5. Each iteration , indexing starts from the first unsorted
element. Steps 1 to 4 are repeated until all the elements are
placed at their correct positions.
Insertion sort:
1. The first element in the array is assumed to be sorted.
Take the second element and store it separately in key.
2. Compare key with the first element. If the first element is
greater than key, then key is placed in front of the first
element.
3. Now, the first two elements are sorted.
4. Take the third element and compare it with the elements
on the left of it. Placed it just behind the element smaller
than it. If there is no element smaller than it, then place it
at the beginning of the array.
5. Similarly, place every unsorted element at its correct
position.
Ex. No:2 IMPLEMENT STACK AND QUEUE DATA
Date: STRUCTURES USING CLASSES AND
OBJECTS.
Aim:
To implement the stack and queue data structures using classes and
objects.
Algorithm:
1.Each node in the queue contains data and link to the next node.
Front and rear pointer points to first and last node inserted in the queue.
ALGORITHM:
Aim:
To write a java program to find the area of different shapes by
using abstract class.
Algorithm:
Aim:
To write a java program to find the area of different shapes by using
interface
Algorithm:
1. Start
2. Create an interface named area that contains two double
values and initializes the pi value as 3.14.
3. Create a class triangle that implements the interface area for
getting base and height values then compute the area and
prints the area of the triangle by using the main method.
4. Create a class rectangle that implements the interface area for
getting length and breathe values then compute the area and
prints the area of the triangle by using the main method.
5. Create a class circle that implements the interface area for
getting radius and compute the area and prints the area of the
circle by using the main method.
6. Create object for a class in memory and assign it to the
reference variable, then the main method is invoked.
7. Stop.
Ex. No:6 CREATING OWN
Date: EXCEPTIONS
AIM:
ALGORITHM:
AIM:
ALGORITHM:
AIM:
To write a java program to implement file information such as reads a
file name from the user, displays information about whether the file
exists, whether the file is readable, or writable, the type of file and the
length of the file in bytes.
ALGORITHM:
Ex. No:9
IMPLEMENT THE FEATURES OF
Date: GENERICS CLASSES
AIM:
ALGORITHM:
Ex. No:10
Date: Develop applications using JavaFX controls,
layouts and menus.
Aim:
To develop applications using javafx controls, layouts and menus.
Algorithm:
1. A menu is a list of options or commands presented to the user,
typically menus contain items that perform some action.
2. The contents of a menu are known as menu items and a menu
bar holds multiple menus.
3. You can create a menu by instantiating
the javafx.scene.control.Menu class.
4. Adding sub menus in a layout.
5. To create a menu –Instantiate the Menu class,Create a required
number of menu items by instantiating the MenuItem class,Add
the created menu items to the observable list of the menu.
6. To add sub-menu, you just need to add a menu to another menu.
Ex. No:11
Date:
MINI PROJECT - OPAC
SYSTEM
AIM:
ALGORITHM: