JP Lab Internal -I
JP Lab Internal -I
(Autonomous)
Nizampet Road, Bachupally, Hyderabad-500090
Department Of IT
II B. Tech II Semester I Lab Internal Examinations, February - 2025
Date: 21/02/2025 Duration :2Hr Max Marks: 10
1. a) Write a Java program for finding factorial of a given number using encapsulation .
b) Write a Java program to illustrate method overloading.
2. a) Write a Java program to create a student array for taking input roll number, name and
student marks for 5 students and print their total marks and average marks.
b) Write a Java program to illustrate constructor overloading.
5. a)Write a Java Program for Guessing Game Using Conditional and Iterative Statements.
( Generate the random number and guess the number from user i/p whether it is correct or not )
b) Write a program to illustrate user defined exception that checks the internal External marks if
the internal marks are greater than 40 it raise the exception “internal Marks are exceed”, if the
external marks are greater than 60 exception is raised and Display the message the “external
marks are exceed.
6. a) Write a Java program with an abstract class Shape that has an abstract method calculateArea().
Implement subclasses Rectangle and Circle with appropriate implementations of
calculateArea().
b) Also, demonstrate method overloading by creating multiple versions of a displayShapeInfo()
method.