Programming With Objects Lab Manual
Programming With Objects Lab Manual
Programming With Objects Lab Manual
III Semester: CSE / IT / CSIT / CSE (AI&ML) / CSE (DS) / CSE (CS)
Course Code Category Hours / Week Credits Maximum Marks
L T P C CIA SEE Total
AITC03 Core
0 0 3 1.5 30 70 100
Contact Classes: Nil Tutorial Classes: Nil Practical Classes: 36 Total Classes: 36
Prerequisite: Python Programming Laboratory
I. COURSE OVERVIEW:
The course covers object oriented programming paradigm. Topics covered include object oriented concepts such as
abstraction, inheritance, and polymorphism for demonstrating real world entity representation and creation of
reusable software components. The main objective of the course is to teach the students how identify and implement
object oriented concepts, file handling and web page design and establishing access with databases from java
programs. This course reaches to student by power point presentations, lecture notes, and lab which involve the
problem solving in mathematical and engineering areas.
II. COURSE OBJECTIVES:
The students will try to learn:
I. The object-oriented programs in java.
II. The implementation of java programs for demonstrating object oriented concepts such as abstraction,
inheritance and polymorphism.
III. The demonstration of file accessing and web based user interface creation.
IV. Database connectivity in java and implement GUI applications.
Week-4: Interface
Write a program that creates a user interface to perform integer division. The user enters two numbers in the text
fields, Num1 and Num2. The division of Num1 and Num2 is displayed in the Result field when the Divide button is
clicked. If Num1 and Num2 were not integers, the program would throw a Number Format Exception. If Num2 were
zero, the program would throw an Arithmetic Exception Display the exception in a message dialog box.
Week-5: Multithreading
a. Write a java program that implements a multi-thread application that has three threads. First thread generates
random integer every 1 second and if the value is even, second thread computes the square of the number and
prints. If the value is odd, the third thread will print the value of cube of the number.
b. Write a java program that correct implements of producer consumer program.
Week-6: Files
a. Write a java program that reads a file name from the user, and then displays information about whether the file
exists, whether the file is readable, whether the file is writable, the type of file and the length of the file in bytes.
b. Write a java program that displays the number of characters, lines and words in a text file.
c. Write a java program that reads a file and displays the file on the screen with line number before each line.
Week-7: Files
a. Suppose that table named table.txt is stored in a text file. The first line in the file is the header, and the remaining
lines correspond to rows in the table. The elements are separated by commas. Write a java program to display the
table using labels in grid layout.
b. Write a java program that connects to a database using JDBC and does add, delete, modify and retrieve
operations.
Week-9: Files
a. Write a java program that takes tab separated data (one record per line) from a text file and insert them into a
database.
b. Write a java program that prints the metadata of a given table.
Week-12: Calculator
Write a java program that works as a simple calculator. Use a grid layout to arrange buttons for the digits and for the
+,-,*, % operations. Add a text field to display the result. Handle any possible exception like divided by zero.
Week-13: Applet
a. Develop an applet that displays a simple message.
b. Develop an applet that receives an integer in one text field and computes its factorial value and returns it in another
text field, when the button named ―compute‖ is clicked.
Reference Books:
1. P. J. Deitel, H. M. Deitel, ―Java for Programmers‖, Pearson Education, PHI, 4 th Edition, 2007.
2. P. Radha Krishna, ―Object Oriented Programming through Java‖, Universities Press, 2 nd Edition, 2007
3. Bruce Eckel, ―Thinking in Java‖, Pearson Education, 4 th Edition, 2006.
4. Sachin Malhotra, Saurabh Chaudhary, ―Programming in Java‖, Oxford University Press, 5 th Edition, 2010.
Web References:
1. www.niecdelhi.ac.in
2. https://www.linkedin.com/in/achin-jain-85061412