0% found this document useful (0 votes)
123 views

Java Manual

This document contains an experiment list for a Java Programming lab class. It includes 11 sections that cover Java programming concepts like control structures, arrays, vectors, strings, functions, object-oriented programming, exceptions, multithreading, applets, AWT, and Swing. Some example programs listed are calculating prime numbers in a range, checking if a number is a vampire number, sorting student names by total marks, and creating a registration form using AWT. The document was prepared by the Department of Information Technology for the academic year 2020-21.

Uploaded by

Mahek Vora
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views

Java Manual

This document contains an experiment list for a Java Programming lab class. It includes 11 sections that cover Java programming concepts like control structures, arrays, vectors, strings, functions, object-oriented programming, exceptions, multithreading, applets, AWT, and Swing. Some example programs listed are calculating prime numbers in a range, checking if a number is a vampire number, sorting student names by total marks, and creating a registration form using AWT. The document was prepared by the Department of Information Technology for the academic year 2020-21.

Uploaded by

Mahek Vora
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Department of Information Technology

(AY: 2020-21)
Experiment list
Sub – Java Programming Lab
Class – SE IT

1. To implement Java Program Structures & Simple Programs


i. WAP to display hello Message on screen.
ii. Write a Java program that reads a positive integer from command line and count
the number of digits the number (less than ten billion) has.

2. To implement Java control statements and loops


i. WAP to find roots of a Quadratic equation. Take care of imaginary values.

ii. Write a menu driven program using switch case to perform mathematical operations.

iii. WAP to display odd numbers from given range/ prime numbers from given range

iv. WAP to display default value of primitive data types

v. WAP to display the following patterns:

1
2 1
1 2 3
4 3 2 1
1 2 3 4 5
6 5 4 3 2 1
1 2 3 4 5 6 7

A
CB
FED
JIHG

3. To implement Arrays

i. WAP to find whether the entered 4 digit number is vampire or not. Combination of
digits from this number forms 2 digit number. When they are multiplied by each
other we get the original number. (1260=21*60, 1395=15*93, 1530=30*51)
ii. WAP to display the following using irregular arrays
1
23
456
iii.
4. To implement Vectors
i. WAP that accepts a shopping list of items and performs the following operations: Add an
item at a specified location, delete an item in the list, and print the contents of the vector
ii. Write a java programs to find frequency of an element in the given Vector array.

5. To implement Strings
i. WAP to check if 2 strings are Meta strings or not. Meta strings are the strings
which can be made equal by exactly one swap in any of the strings. Equal string
are not considered here as Meta strings.
Example: str1 = "geeks”, str2 = "keegs"
By just swapping 'k' and 'g' in any of string, both will become same.
Example: str1 = "Converse", str2 = "Conserve"
By just swapping 'v' and’s’ in any of string, both will become same.

Algorithm (if reqd):


1. Check if both strings are of equal length or not, if not return false.
2. Otherwise, start comparing both strings and count number of unmatched characters and also
store the index of unmatched characters.
3. If unmatched characters are more than 2 then return false.
4. Otherwise check if on swapping any of these two characters in any string would make the
string equal or not.
5. If yes then return true. Otherwise return false.

ii. Write a java program to count number of alphabets, digits, special symbols, blank
spaces and words from the given sentence. Also count number of vowels and
consonants.

1. To implement Functions, recursive functions and overloading


i.

ii. WAP to display area of square and rectangle using the concept of overloaded functions
iii. Write menu driven program to implement recursive functions for following tasks.
a) To find GCD and LCM
b) To find XY
c) To print n Fibonacci numbers
d) To find reverse of number
e) To 1+2+3+4+…….+ (n-1)+n
f) Calculate sum of digits of a number

2. To implement Array of Objects


i. WOOP to arrange the names of students in descending order of their total marks, input
data consists of students details such as names, ID.no, marks of maths, physics,
chemistry. (Use array of objects

3. To implement Constructors and overloading


i. WAP find area of square and rectangle using overloaded constructor
ii.

4. To implement Abstract classes


i. Write a abstract class program to calculate area of circle, rectangle and triangle

5. To implement Inheritance, interfaces and method overriding


i. WAP to implement three classes namely Student, Test and Result. Student class
has member as rollno, Test class has members as sem1_marks and sem2_marks
and Result class has member as total. Create an interface named sports that has a
member score (). Derive Test class from Student and Result class has multiple
inheritances from Test and Sports. Total is formula based on sem1_marks,
sem2_mark and score.

Student

Test Sports

Result

6. To implement Package
i. WAP to create a user defined package & import the package in another program.
ii. Make jar files for library packages
7. To implement exceptions in Java
i. Write a Java Program to input the data through command Line and Find out total
valid and in-valid integers. (Hint: use exception handling)
ii. Write a Java Program to calculate the Result. Result should consist of name,
seatno, date, center number and marks of semester three exam. Create a User
Defined Exception class MarksOutOfBoundsException, If Entered marks of any
subject is greater than 100 or less than 0, and then program should create a user
defined Exception of type MarksOutOfBoundsException and must have a
provision to handle it.

8. To implement Multithreading
i. Write java program to print Table of Five, Seven and Thirteen using
Multithreading (Use Thread class for the implementation). Also print the total
time taken by each thread for the execution.
ii. Write java program to implement the concept of Thread Synchronization

9. To implement Applets.
i. Write java program to draw the house on an applet.
ii. Write java program to create an advertisement banner on an applet using
multithreading

10. Designing Graphical User Interfaces in Java using AWT and Event handling
i. Write java program to create a registration form using AWT.
ii. On Applet: Take a Login and Password from the user and display it on the third
Text Field which appears only on clicking OK button and clear both the Text
Fields on clicking RESET button.

11. Develop simple swing applications and complex GUI using Java Swing classes.
i. Write a program to create a window with four text fields for the name, street, city
and pin code with suitable labels. Also windows contains a button MyInfo. When
the user types the name, his street, city and pincode and then clicks the button, the
types details must appear in Arial Font with Size 32, Italics.
ii. WA applet with 4 swing buttons with suitable texts on them. When the user presses a
button a message should appear in the label as to which button was pressed by the user

PAC Committee:

Prof.Vinaya Sawant
Prof. Stevina Correia
Prof. Anusha Vegesna

Prof. Stevina Correia Dr. Meera Narvekar


Subject Incharge Head of Dept, I.T.

You might also like