0% found this document useful (0 votes)
25 views2 pages

Practical File Questions

Uploaded by

gptharshad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

Practical File Questions

Uploaded by

gptharshad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

B.Tech.

III
Batch (2024-2028)
CSP0309 (Object-Oriented Programming using Java)

NOTE: All questions are compulsory. The file should contain the program code and output
of the program along with the proper title page and index page.

Format of Index page will be –


Index Page
| Sr. No | Week/Topic | Experiment Title | Page No. |

Lab Questions for 14-07-2025 to 19-07-2025


1. Write a Java program to print "Hello, World!" to the console.
2. Write a program that prompts the user for their name and then greets them by name.
3. Write a program that calculates the area of a rectangle given its length and width as
input from the user.
4. Implement a program to find the largest of three numbers entered by the user.
5. Write a Java program that checks if a given number is even or odd.
6. Write a program to find the factorial of a given number.
7. Write a program to check if a year is a leap year.
8. Implement a program to print the first N natural numbers.
9. Write a program to find the sum of the first N natural numbers.
10. Develop a Java program that calculates the average of a list of numbers.

Lab Questions for 21-07-2025 to 26-07-2025


11. Write a program to print the Fibonacci sequence up to a certain number.
12. Implement a program to reverse a given string.
13. Write a program to find the sum and average of elements in an array.
14. Implement a program to search for a specific element in an array.
15. Write a program to sort an array in ascending or descending order (selection sort,
bubble sort, insertion sort).
Lab Questions for 28-07-2025 to 02-08-2025
16. Develop a Java program to copy the elements of one array into another.
17. Write a program to check if a given string is a palindrome.
18. Implement a program to count the number of occurrences of each character in a string.
19. Create a class Student with attributes like name, roll number, and marks. Implement
methods to calculate the total marks and average.
20. Write a program to demonstrate the concept of inheritance by creating a class
GraduateStudent that inherits from Student and includes additional attributes like
thesis title.
Lab Questions for 04-08-2025 to 09-08-2025
21. Create a class Calculator with methods for basic arithmetic operations (addition,
subtraction, multiplication, division).
22. Write a program to demonstrate method overloading by creating methods with the same
name but different parameter lists in a class.
Lab Questions for 11-08-2025 to 16-08-2025
23. Develop a Java program to demonstrate static methods and variables using an example
like Math class.
24. Create a class Employee with a toString() method that overrides the default behavior
and provides a meaningful representation of the employee object.
25. Write a program to handle the ArithmeticException that might occur when dividing
by zero.
Lab Questions for 18-08-2025 to 23-08-2025
26. Implement a program to handle the NumberFormatException that might occur when
trying to parse a non-numeric string to an integer.
27. Develop a Java program to handle the IndexOutOfBoundsException that might occur
when accessing an element outside the array bounds.
28. Write a program to create a custom exception class for a specific scenario (e.g.,
InsufficientFundsException).
Lab Questions for 25-08-2025 to 30-08-2025
29. Write a program to demonstrate the creation of a simple thread that prints a message.
30. Implement a program to demonstrate synchronized access to shared resources between
threads.
31. Develop a Java program that uses threads to simulate a producer-consumer scenario.

You might also like