Object Oriented Programming Lab I
Teaching Scheme
Credits Assigned
(Hrs/week)
Course
Course Name
Code
L T P L T P Total
Object Oriented
25COVSL201 Programming Lab - - 2*+2 - - 2 2
Examination Scheme
Continuous Internal Assessment (CIA) External
IPE Exp Activity Att Total Prac & Oral
30 10 05 05 50 25
IPE: Internal Practical Evaluation (30)
Two (02) internal practical exams of 30 marks each as per below syllabus. 15 marks for Program execution,
05 marks for Program documentation and 10 marks for viva. The average of 02 exams marks would be
considered as IPE.
Exp: Experiments (10)
Program(s) Execution & Problem(s) Solving: 06; On Time: 02; Viva: 02
Activity: [Assignment/Model/Mini Project] (05)
Minimum Two (02) of the above assessment tools each of 05 marks have to be conducted, covering
the course outcomes. The average marks would be considered.
Att: Attendance (05)
As per the rubric provided by the Attendance committee.
*2 hours at class level and 2 hours at batch level per week
Prerequisite: C Programming
Course Objectives:
1 To learn core OOP concepts such as classes, objects, inheritance and polymorphism.
2 To develop proficiency in concepts such as multithreading, exception handling, and the use of
user-defined packages.
3 To familiarize with the fundamental components and structures involved in building Graphical
User Interface (GUI) applications.
Course Outcomes (COs): At the End of the course students will be able to
CO1 To apply fundamental programming constructs. (L3)
CO2 To illustrate the concept of packages, classes and objects. (L3)
CO3 To elaborate the concept of strings, arrays and collection classes to solve problems involving
data manipulation. (L3)
CO4 To implement the concept of inheritance and interfaces. (L3)
CO5 To implement the concept of exception handling and multithreading. (L3)
CO6 Design interactive GUI applications. (L3)
CO
Week
Detailed Contents Map BL Hrs
No.
ped
OOP concepts: Objects, class, Encapsulation, Abstraction, Inheritance, CO1 BL3 2
Polymorphism, message passing, JVM, JDK, JRE
1
Basic programming constructs:Input and output functions in Java:
scanner class, variables, data types, Operators, I/O,
1.1 Write a Java program to input the name, roll number, and CGPA of
a student using the Scanner class.
1.2 Write a Java program that takes the following details such as
Employee ID (String or Integer), Name and Monthly Basic Salary
for employee and perform the following operations:
Calculate the Annual Basic Salary (12 * monthly basic).
Compute the following based on the monthly basic salary :
● HRA (House Rent Allowance) = 20% of basic salary
● DA (Dearness Allowance) = 10% of basic salary
● PF (Provident Fund deduction) = 12% of basic salary
● Gross Monthly Salary = Basic + HRA + DA
● Net Monthly Salary = Gross Salary – PF
● Annual Net Salary = Net Monthly Salary × 12
1.3 Developing Conversion Utilities: Develop any converter, such as
Rupees to dollars, temperature converter, inch to feet, etc.
2 Control Structures, Branching and Loops CO1 BL3 2
if-else, if-else if, switch, loops (for, while and do-while), Branching
Statements - Break, Continue, return
2.1 Given an integer, , perform the following conditional actions:
● If is odd, print Weird
● If is even and in the inclusive range of to , print Not Weird
● If is even and in the inclusive range of to , print Weird
● If is even and greater than , print Not Weird
(https://www.hackerrank.com/challenges/java-if-else/problem)
2.2 Write a Java program that accepts the student's name, roll number,
and marks in five subjects, each out of 100. The program should
validate that all entered marks are between 0 and 100. Calculate
total marks (sum of all subjects), Average marks and Percentage.
Assign an appropriate grade based on the average marks and add a
remark based on the grade.
2.3 Print number pattern using loops.
Use nested loops to generate a triangle number pattern, applying
conditional checks.
2.4 Test your Learning:
Java Loops: Read integer N (2–20) and print its first ten multiples.
(https://www.hackerrank.com/challenges/java-loops-i/problem)
3 Classes & Objects: Class, object, data members, member functions CO2 BL3 2
3.1 Write a Java program to create a Bank Account Simulator with
BankAccount class with the attributes: account_number and
balance. The program should: Create an object of BankAccount,
Set account number and initial balance using setter methods or
direct assignment. Accept a series of operations (deposit or
withdraw) and apply them and Display the final balance after all
operations.
4 Constructors– Types of Constructors, Constructor Overloading CO2 BL3 2
static members and functions, Method Overloading
4.1 Write a Java program that calculates the area of 2D shapes and the
volume of 3D shapes using method overloading. The program
should include the 2D Shapes like Circle, Rectangle, Square,
Triangle, 3D Shapes like Sphere, Cylinder, Cuboid, Cube
4.2 Create a Student class to demonstrate constructor overloading by
allowing the creation of student objects using different
initialization formats. The program should include Student Class
Fields like rollNumber, name, department.
4.3 Write a program that demonstrates use of Static member and static
functions.
5 Array, Strings, String Buffer
5.1 Write a program that demonstrates the use of various methods
available in String class.
CO3 BL3 2
5.2 Write a program that demonstrates the use of various methods
available in StringBuffer class.
5.3 Write a program to find the Maximum Element in an Integer Array
6 Internal Assessment -I & Submission
7 Inheritance:Types, Method overriding , super and final keyword
7.1 Create a Java program to demonstrate inheritance by designing an
Employee superclass and a Manager subclass. The program should
include the appropriate methods to demonstrate the inheritance
hierarchy. CO4 BL3 2
7.2 Write a Java program to create a Vehicle class with a method
showSpeed() that displays the default speed of a generic vehicle.
Create a Car subclass that overrides this method to show specific
speed. Then, extend Car with a SportsCar class that further overrides
showSpeed() and uses the super keyword to invoke both the Car and
Vehicle implementations of showSpeed().
8 Abstract Classes & Interfaces– Abstract class and methods and
Interfaces
8.1 Write a program that declares an abstract class Shape that
implements the Drawable method and also includes a field
String color and an abstract method calculateArea().
Implements two subclasses:
Circle → stores radius, overrides both methods CO4 BL3 2
Rectangle → stores length and breadth, overrides both methods
In the main() method: Use polymorphism to refer to Shape
references and call overridden methods
8.2 Write a Java program that defines a Payment interface with: void
processPayment(double amount)
● Implements ‘this’ interface in two classes:
1. CreditCardPayment with additional fields: cardNumber,
cardHolderName, cvv
2. UPIPayment with additional fields: upiId, mobileNumber
● Use validation where necessary (e.g., CVV must be 3 digits,
UPI ID must contain '@')
● In main() method: Accept details from user
Display confirmation messages
9 Packages in java : User defined packages, Access specifiers
9.1 Write a Java program that demonstrates the concept of user-defined CO2 BL3 2
packages and the use of all four access specifiers (private, default,
protected, public) through appropriate class and method
structures.
10 Exception Handling – Types of Exception, built-in Exceptions, try-
catch, custom exception (throw and throws), finally
10.1 Write a Java program to perform the division of two numbers. The
program should:
● Use try-catch to handle ArithmeticException (divide by
zero)
● Use a try-catch to handle invalid inputs
(InputMismatchException)
● Use a finally block to print a message that runs regardless
of exception CO5 BL3 2
● Loop until the user provides valid input and a successful
division occurs
10.2 Write a Java program that:
● Defines a custom checked exception class
InvalidAgeException
● Throws InvalidAgeException if the age is less than 18
● Catches the exception and displays an appropriate error
message
● Uses a loop to retry input until valid age is entered
● Displays a success message on valid age entry
11 Thread lifecycle, thread class methods, creating threads
CO5 BL3 2
11.1 Write a Java program to demonstrate the concept of
multithreading using both approaches:
1. Extending the Thread class,
2. Implementing the Runnable interface.
The program should show how multiple threads can run
concurrently and independently, and how to control their execution
using thread methods.
12 GUI Programming – JavaFX basics, layout managers, Event handling,
JDBC connectivity
12.1 Write a JavaFX program to build a basic calculator GUI that
performs simple arithmetic operations: Addition, Subtraction,
Multiplication, and Division. Use ActionListener to detect button
clicks and perform calculations. Handle invalid input (e.g., non- CO6 BL3 2
numeric entries) using try-catch and display appropriate error
messages. For division, include zero-check to avoid divide-by-zero
errors
12.2 Write a Java program using JavaFX to create a login form with
Backend connectivity using JDBC
13 Internal Assessment -II & Submission
14 Assignment
Building a Database-Driven GUI (JavaFX + JDBC)
(https://www.codeproject.com/Articles/1197811/JavaFX-JDBC-
Application) CO6 BL5 2
Build a complete GUI-based application integrating OOP, file
handling, and event handling and database connectivity.
Text Books :
1 Herbert Schildt, Java: The Complete Reference, McGraw Hill
2 E. Balagurusamy, Programming with Java, McGraw Hill
3 Cay S. Horstmann, Core Java Volume I – Fundamentals, Pearson
4 Kathy Sierra & Bert Bates, Head First Java, O’Reilly
Reference Books :
1 Oracle Java Documentation – https://docs.oracle.com/javase/
2 JavaTpoint Java Tutorial – https://www.javatpoint.com/java-tutorial
3 GeeksforGeeks Java Guide – https://www.geeksforgeeks.org/java/
4 W3Schools Java Tutorial – https://www.w3schools.com/java/