0% found this document useful (0 votes)
14 views9 pages

Java Syllabus

Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
Download as odt, pdf, or txt
0% found this document useful (0 votes)
14 views9 pages

Java Syllabus

Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1/ 9

21CS215B: JAVA PROGRAMMING LAB

LIST OF EXPERIMENTS

1) Use eclipse or Netbean platform and acquaint with the various menus,
create a test project, add a testclass and run it see how you can use auto
suggestions, auto fill. Try code formatter and code refactoringlike
renaming variables, methods and classes. Try debug step by step with a
small program of about 10 to15 lines which contains at least one if else
condition and a for loop.

2) Write a java program to demonstrate mutability of StringBuffer class to


find out whether a givenstring is Palindrome or not?

3) Write a program to create a user defined package named ‘sample’ and


demonstrate importing thispackage in other program.

4) Write a Java program that works as a simple calculator. Use a grid


layout to arrange buttons for thedigits and for the +, -,*, % operations. Add
a text field to display the result. Handle any possibleexceptions like divide
by zero.

5) a) Develop an applet that displays a simple message.


b) Develop an Applet that receives an integer in one text field & compute
its factorial value & returnsit in another text filed when the button
“Compute” is clicked

6) Write a program that creates a user interface to perform integer


divisions. The user enters twonumbers in the text fields, Num1 and Num2.
The division of Num1 and Num2 is displayed in the Resultfield when the
Divide button is clicked. If Num1 or Num2 were not an integer, the
program would throwa Number Format Exception. If Num2 were Zero, the
program would throw an Arithmetic Exception
Display the exception in a message dialog box

7) Write a java program that implements a multi-thread application that has


three threads. First threadgenerates random integer every 1 second and if
the value is even, second thread computes the square ofthe number and
prints. If the value is odd, the third thread will print the value of cube of
the number.

8) Write a java program that simulates a traffic light. The program lets the
user select one of three lights:red, yellow, or green with radio buttons. On
selecting a button, an appropriate message with “stop” or“ready” or “go”
should appear above the buttons in a selected color. Initially there is no
message shown.

9) Write a java program to create an abstract class and abstract methods

10) Suppose that a table named Table.txt is stored in a text file. The first
line in the file header and theremaining lines correspond to row in the
table. The elements are separated by commas. Write a Javaprogram to
display the table using labels in grid layout.

11) Write a Java program that handles all mouse events and shows the
event name at the center of thewindow when a mouse event is fired. (Use
adapter classes).

12) Write a java program that loads names and phone numbers from a text
file where the data isorganized as one line per record and each field in a
record are separated by a tab (\t).it takes a name orphone number as input
and prints the corresponding other value from the hash table(hint: use hash
tables)

13) Write a java program that correctly implements the producer–


consumer problem using the conceptof inters thread communication.

14) Write a java program to list all the files in a directory including the
files present in all itssubdirectories.
DATABASE MANAGEMENT SYSTEMS LAB

Experiment 1:
Student should decide on a case study and formulate the problem
statement.

Experiment 2:
Conceptual Designing using ER Diagrams (Identifying entities, attributes,
keys and relationships
between entities, cardinalities, generalization, specialization etc.)
Note: Student is required to submit a document by drawing an ER
Diagram for a given problem.

Experiment 3
Converting the above ER Model in to Relational Model (Represent entities
and relationships in Tabular
form, represent attributes as columns, identifying keys)
Note: Student is required to submit a document showing the database
tables created for a given problem
domain.

Experiment 4
Normalization -To remove the redundancies and anomalies in the above
relational tables, Normalize up
to Third Normal Form

Experiment 5
Creation of Tables using SQL- Overview of using SQL tool, Data types in
SQL, Creating Tables (along
with Primary and Foreign keys), Altering Tables and Dropping Tables

Experiment 6
Practicing DML commands- Insert, Select, Update, Delete.

Experiment 7
Practicing Queries using ANY, ALL, IN, EXISTS, NOT EXISTS, UNION,
INTERSECT,
CONSTRAINTS etc.
Experiment 8
Formulate Sub queries (Nested, Correlated) and Joins (Inner, Outer and
Equi).

Experiment 9
Queries using COUNT, SUM, AVG, MAX, MIN, GROUP BY, HAVING,
Creating and Dropping
views.

Experiment 10:
PL/SQL programs using conditional statements and loops.

Experiment 11
Triggers - creation of trigger, Insertion using trigger, Deletion using
trigger, Updating using trigger

Experiment 12
PL/SQL programs using procedures.

Experiment 13
PL/SQL programs on Cursors- Declaring Cursor, Opening Cursor,
Fetching the data, closing the
cursor.

PYTHON PROGRAMMING LAB

1. Write a Python program to convert temperatures to and from Celsius,


Fahrenheit. [Formula : c/5 = f-32/9 ]

2. Python Program for factorial of a number

3. Python Program for simple interest using def

4. Python Program to Check if a Number is Odd or Even

5. Write a python program to find largest of three numbers.


6. Python program to print all Prime numbers in an Interval

7. Python Program to Find Factorial of Number Using Recursion

8. Python program to copy all elements of one array into another array

9. Python Program to Add Two Matrices

10. Python Program to reverse a string

11. Write a program to create, append, and remove lists in python.

12. Write a program to demonstrate working with tuples in python.

13. Write a program to demonstrate working with dictionaries in python

14. Python Program to create and sort a dictionary


15. Write a script named copyfile.py. This script should prompt the user for
the names oftwo text files. The contents of the first file should be input and
written to the secondfile

16. Write a simple program using numpy

17. Write a simple program using pandas

PROGRAMMING FOR PROBLEM SOLVING LAB

WEEK-1:
a. Write a C program to find simple interest and compound interest.
b. Write a C program to convert Celsius to Fahrenheit.
c. Write a C Program to swap two numbers.
d. Write a C program to perform all arithmetic operations (+, -, *, / , %).
e. Write a simple program that prints the results of all the operators
available in C(Including pre/ post increment, bitwise and/or/not , etc.).
Read required operandValues from standard input.
WEEK-2:
a. Write a simple program that converts one given data type to another
using autoConversion and casting. Take the values from standard input.
b. Write a C program to check whether the given number is even or odd
using ConditionalOperator.
c. Write a C program to find the Largest of two numbers.
d. Write a C program to print ascending order of three given integers.

WEEK-3:
a. Write a C program to Check the given year is leap year or not.
b. Write a C program to find the roots of quadratic equation.
c. Write a C Program to implement arithmetic calculator using switch case.
d . Write a program that declares Class awarded for a given percentage of
marks,where (use else if ladder and switch) <40%= Failed, 40% to <60%
= Second class, 60% to<70%=First class, >= 70% = Distinction. Read
percentage from standard input.

WEEK-4:
a. Write a program that prints a multiplication table for a given number and
the number of rowsin the table. For example, for a number 5 and rows = 3,
the output should be:
5x1=5
5 x 2 = 10
5 x 3 = 15
b. Write a program that shows the binary equivalent of a given positive
numberbetween 0 and 255.
c. Write a C program to find sum of individual digits of the given integer.
d. Write a C program to find factorial of a given number.

WEEK-5:
a. Write a program that finds if a given number is a prime number
b. Write a C program to check whether the given number is palindrome or
not.
c. Write a C program to print Fibonacci series.
d. Write a C program to read in two numbers, x and n, and then compute
the sum of this geometricprogression: 1+x+x^2+x^3+…… +x^n.
For example: if n is 3 and x is 5, then the program computes 1+5+25+125.
WEEK-6:
a. Write a C program to calculate the following, where x is a fractional
value.1-x/2 +x^2/4-x^3/6.
b. Write a C program to display the prime numbers from 1 to n(where n
value isGiven by user)
c. Write a C program to construct a pyramid of numbers as follows:
1*11*
12**2322**
123***456333***
4444**
*
d. Write a C program to construct the Pascal triangle

WEEK-7:
a. Write a C program to find largest, smallest numbers and average in a list
of arrayelements.
b. Write a C program to find mean, variance, standard deviation for a given
list ofelements.
c. Write a menu driven C program that allows a user to enter n numbers
and then choose betweenfinding the smallest, largest, sum, or average. The
menu and all the choices are to be functions.Use a switch statement to
determine what action to take. Display an error message if an invalid
choice is entered.

WEEK-8:
a. Write a C program to transpose a matrix.
b. Write a C program to perform the Addition of Two Matrices.
c. Write a C program to perform the Multiplication of Two Matrices.

WEEK-9:
Write programs using non recursive and recursive functions for the
following
a. Find GCD.
b. Find the factorial of a given number.
c. Generate the Fibonacci series.
d. Find xn
WEEK-10:
a. Write a C program to swap two integers using following methods.
i. call by value ii. call by reference
b. Write a program for reading elements using a pointer into an array and
display theValues using array.
c. Write a program for display values reverse order from an array using a
pointer.
d. Write a program through a pointer variable to sum of n elements from
an array.

WEEK-11:
a. Write a C program to insert a sub-string into a given main string from a
givenposition.
b. Write a C program to delete n characters from a given position in a
given string.
c. Write a C program to arrange given n strings in alphabetical order.
d. Write a C program to convert a Roman numeral ranging from I to L to
its decimal equivalent.

WEEK-12:
a. Write a C program that converts a number ranging from 1 to 50 to
Roman equivalent
b. Write a C program to determine if the given string is a palindrome or not
(Spelledsame in both directions with or without a meaning like madam,
civic, noon, abcbaetc.)
c. Write a C program that displays the position of a character ch in the
string S or – 1if S doesn‘t contain ch.
d. Write a C program to count the lines, words and characters in a given
text.

WEEK-13:
a. Write a C program to find total and average marks for five subjects of
three students usingstructures.
b. Write a C program to demonstrate nested structures.
c. Write a C program to display the contents of a file to standard output
device.
d. Write a C program which copies one file to another into another file.
e. Write a C program to merge two files into a third file.
(i.e., the contents of the first file followed by those of the second are put in
the third
file)

WEEK-14:
a. Write a C program to reverse the contents of a file.
b. Write a C program that does the following:
It should first create a binary file and store 10 integers, where the file name
and 10 values aregiven in the command line. (hint: convert the strings
using atoi function)
Now the program asks for an index and a value from the user and the value
at that index shouldbe changed to the new value in the file. (hint: use fseek
() function)The program should then read all 10 values and print them
back.
c. Write a C program to count the number of times a character occurs in a
text file. The file nameand the character are supplied as command line
arguments.
d. Write a C program that uses non recursive function to search for a Key
value in aGiven list of integers using linear search method.
e. Write a C program that uses non recursive function to search for a Key
value in a given sortedlist of integers using binary search method.

WEEK-15:
a. Write a C program that implements the Bubble sort method to sort a
given list of integers inascending order.
b. Write a C program that sorts the given array of integers using selection
sort in
c. descending order Write a C program that sorts the given array of
integers using insertion sort inascending order

You might also like