OOT Lab
Assignment (ECS-553)
CS 5th Semester
|
S.No.
|
Program
|
|
1
|
Write a
program in java which prints your name using command line arguments.
|
|
2
|
Write
a program in java which enters three number using command line arguments and
print sum and average of the number
|
|
3
|
Write
a program to swap the value of 2 variables without using 3rd variable
|
|
4
|
Write
a program to calculate the sum of digits of a given integer no.
|
|
5
|
Write
a program to compute the sum of the first and last digit of a given number.
|
|
6
|
Write
a program to calculate and print first n Fibonacci numbers.
|
|
7
|
Write
a program to reverse the given number.
|
|
8
|
Write
a program in java which enter the number using DataInputStream and check
whether the entered number is even or odd.
|
|
9
|
Write
a program that calculate and print the roots of a quadratic equation
ax^2+bx+c = 0 and appropriate message should be printed if root are complex
|
|
10
|
Write
an application that reads a string and determines whether it is a palindrome.
|
|
11
|
Write
a program to enter a sentence form keyboard and also find all the words in
that sentence with starting character as vowel.
|
|
12
|
write
a program to print the string 'ALLAHABAD' in following format
A
A L
A L L
A L L A
A L L A H
A L L A H A
A L L A H A B
A L L A H A B A
A L L A H A B A D
|
|
13
|
Write
a Program in java which creates the array of size 5; find the sum and average
of the five numbers.
|
|
14
|
[Package
and Array] Create a package named Mathematics and add following classes to
it:
i)
A class Matrix with methods to add and multiplt matrices.
ii)A
class Complex with methods to add, multiply and subtract complex numbers.
Write
a Java program importing the Mathematics package and use the classes defined
in it.
|
|
15
|
Write a program in java which input
the String “Ajay Kumar Maurya” and checks whether the string ends with Maurya
or not.
|
|
16
|
Write a program in java which input
the string “Ajay Kumar Maurya” and
I.
Find the length of the string.
II.
Check whether the string contains the substring
“jay”.
III.
Concatenate Mr at the starting of the name.(Mr.
Ajay Kumar Maurya).
|
|
17
|
[Class
and Object] Define a class Worker with the following specifications:
Data Member : workerNumber, nameOfWorker,
wegeRatePerHour, totalWage,
hoursWorkedByAWorker
Methods :>To
assign initial value for worker number, name of worker, hours worked by
worker, wage rate per hour. [ public Worker(......) ]
>
To calculate total wage to be paid to the worker. [ public void
wageToBePaid()
>
To display all the information - [ public void displayWorkerDetai( ) ]
Write a program in Java to test the
program.
|
|
18
|
Write
a program in java which handles the runtime exception using try catch block.
|
|
19
|
[Class
and Object] Define a class named “Test” with an instance variable num. Define
a Constructor and a method named
getReverse(). Create an object of the class
pass an integer to the constructor to initialize num. Call getReverse() to
get the reverse and print the reverse no.
|
|
20
|
[Class and
Object] Calculate the area of circle
and cylinder by creating methods name areaOfCircle and areaOfCylinder
in a class named Area using a constant attribute PI=3.14.
|
|
21
|
Write
a program in java which creates a class name works having three methods
input, sum and show. Create the object of the class and invoke the methods of
the class on the created object
|
|
22
|
Create
a class SimpleCalculator that has functionality of addition, substraction
division, multiplication, square and squareroot and then create another class
ScientificCalculator that has functionality of impleCalculator and some other
functionality like sin, cos, tan.
|
|
23
|
[Overloading]Create
a java program that has three version of add method which can add two, three, and four integers
|
|
24
|
Write
a program in java having class good1, class good2 extends good1 and good3
extends good2.Check that all the methods are accessible in inherited
class.good1 having method data,good2 having method sum and good3 having
method show.
|
|
25
|
[Overloading]Write
a Java prgram that uses an overloaded method volume() that returns volume of
different structures.
The first version takes one float side
of a cube and returns its value. (side*side*side)
The second version takes float radius
and float height and returns the volume of a cylinder. (PI*r^2*h)
The third version takes float length,
float width and float height of a rectangular box and returns a volume.
(l*w*h)
|
|
26
|
Create
an abstract base class titled ‘Shapes’. It should contain a method Area ()
which returns area of a particular shape. Derive two classes from Shapes
titled Rectangle(width*height) and
triangle(1/2*base*height). Implement the method Area () in both classes to
print the area.
|
|
27
|
Write
a Program in Java to create a Swing Application Display your name using
label.
|
|
28
|
Write
a Program in Java to create a user define Package.
|
|
29
|
Write a program in java which creates
two threads, Main thread and Child Thread and print the even no using Main
Thread and odd no using Child Thread.
|
|
30
|
[Multi-Threading]
Write a Java program to
i)
Create a thread which can print multiplication table of any integer.
ii)
Print the name, priority, and group of the thread.
iii)
Change the name of the current thread to "JAVA"
iv)
Display the details of current thread.
|
|
31
|
Write
a program in java which creates an Applet and display your name in an html
page using that Applet.
|
|
32
|
[Applet]
Write a Java applet to
i) Display
the name and address of your college. Use setBackgroud(), setFont() and
setForeground() method to
set
color and font of text, and color of background.
ii) Display an image.
|
|
33
|
[Applet]
Write a Java applet to draw a traffic signal light.
|
|
34
|
Write
a program in java which creates an Applet and draw a rectangle inside the
applet with a background of Red color. Display that applet in an html page.
|
|
35
|
[Applet]
Write a Java program to create a calculator with (add, sub, div, mul, sqrt)
functionality using applet and test the program using <applet> HTML
tags.
|
|
36
|
Write
a program in java to create a dsn(Data Source Name) named ucer and database
student in ms access contains table school having columns name and city. Save
the value of name and city in the school database using JDBC.
|
|
37
|
Write a program in java to create a
dsn(Data Source Name) named ucer and
database student in ms access contains table school having columns name and
city. Display the value of name and city in the school database using JDBC.
|
|
38
|
Write a program in java to create a
dsn(Data Source Name) named ucer and
database student in ms access contains table school having columns name and
city .Delete the particular value of name and city in the school database
using JDBC.(take the value from the database)
|
|
39
|
[JDBC]
Ceate a database named College using MS Access with table student having
following fields:
- RollNumber (PK), Branch,
Name
1. Initialize this table with different
values. Write a program in Java to print the details in student table.
2.
[JDBC] Write a java program that
will provide the following utility to previous program:
- Add new student in Student table.
-Delete existing student from
Student table
3. [JDBC] Write a java program that will
perform the search operation for Student by his/her roll number from Student
table.
|
|
40
|
Write
a program in java to implement Network programming using Socket and Server
socket .Client send the number to Server and server return its square to the
client.
|
No comments:
Post a Comment