Lab Planning - OOPJ - 2022-23

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

CHHOTUBHAI GOPALBHAI PATEL INSTITUTE OF TECHNOLOGY

Practical list

Department name: Information Technology & Subject Teacher: Ms. Aayushi Shah
CyberSecurity Mr. Axay Patel
Program & Semester: 3rd sem B.Tech IT & CS- A &
Subject Name: Object Oriented Programming with Java
B
Academic Year: 2022-23 (Odd sem) Subject Code: CE4002

Sr. Contact
Topics
No. Hours
1. Write a program to print “Hello CGPIT” on the console. 1
Write a program to print inputs given from command line 1
2.
arguments on the console.
Write a program to check whether the given number is Armstrong 1
3.
or not.
Write a program using a switch which takes two command-line
arguments.
The first argument is a string (odd, even, avg, sum) specifies the
operation, and the second argument (number N) is the upper limit
4. 1
of the range starting from 0.
Ex.,
Arguments: even 10; Output: 0 2 4 6 8 10.
Arguments: sum 5; Output: 15
5. Write a program that finds factorial of a given number. 1
Write a program to take marks of five students and prints the
6. 2
marks of student in descending order.
Define a class Student which contains following:
Data Members:
− Name of student
− Enrolment number of student
7. − Contact number of student 1
Member Functions:
− To get details of the student
− To display details of the student
Write a program to display details of one students.
Define a class Bank_system which contains following:
Data Members:
− Name of account holder
− Account Number
− Balance
8. 2
Member Functions:
− To get details of the account
− To display the balance
− To search account by account number
Write program for above Bank system that handles five customers.
9. Define a class called TIMEC with Three integer data members for 2
CHHOTUBHAI GOPALBHAI PATEL INSTITUTE OF TECHNOLOGY
Practical list

hours, minutes and seconds and following constructors and


functions.
• Constructor to initialize the object to zero
• Constructor to initialize the object to some constant value
• Member function to add two TIME objects
• Member function to display time in HH:MM:SS format
Write a java program that creates two TIME objects, add them and
display the resultant time in HH:MM:SS format..
Write a Java class ShapeArea which calculates the area of a square,
rectangle, and circle.
10. 2
Write a program to print the area of square, rectangle, and circle.
Demonstrate the concept of method overloading.
Write a java program to find out the payroll system using single
inheritance.
Create one base class and one derived class.
The base class “Emp” contains the data members: emp_name,
emp_no, designation.
11. 2
The derived class “salary” contains the data members: Basic pay,
home rent allowance (HRA).
Write a java program to calculate salary for 5 employees.
The formula for calculating salary:
(Salary = Basic pay + HRA*(Basic Pay) + HRA)
Create a class Product that has data members Product Id, Product
Name, and Price.
Create class ProductDetails by inheriting Product class and having
a method to enter all product details.
12. 2
Create class DisplayDetails by inheriting ProductDetails class and
having a method to display all the details of the product.
Write a program to print details of two products using Multi-level
inheritance.
Create a class Student which has data members enrollment no,
exam number, and student name.
Create class Exam by inheriting student class and having fields to
13. store marks scored in three subjects. 2
It has method to calculate results.
Write a program to print results for two students.
Note: Implement this using all usage of super keyword.
Create an abstract class department with data members
university, college, method display() and abstract method
subject_list().Create subclasses CE and EE which implements the
14. 1
method subject_list().
Write a program to display subjects offered by CE and EE
departments.
Define an interface bird having the methods of food() and voice().
15. Define two classes sparrow and peacock to implement the 1
interface bird.
CHHOTUBHAI GOPALBHAI PATEL INSTITUTE OF TECHNOLOGY
Practical list

Write a program to test the sparrow and peacock classes.


Write a java program that import the user defined package and
16. access the 2
member variable of class that inside the package.
Write a program to handle following exceptions:
1. StringIndexOutOfBoundsException
17 1
2. NullPointerException
3. NumberFormatException
Write a program to generate and handle a custom exception to
18 validate 1
the entered phone number.
Write an application that executes two threads. One thread
Displays “I’m
Thread 1“every 1,000 milliseconds. And the other displays “I’m
19 Thread 2 2
“every 3,000 milliseconds. Create the threads by
a) implementing the Runnable interface
b) extending Thread class.
20. Write a program to copy the content of one file into another file. 2
Total contact hours: 30
Name & Signature of Subject Teacher: Ms. Aayushi Shah, Mr. Axay Patel

Name & Signature of Subject In-Charge: Ms. Aayushi Shah

Name & Signature of Head of Department: Ms. Purvi Tandel

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy