Bharatiya Vidya Bhavan’s
Sardar Patel Institute of Technology
(Autonomous Institute Affiliated to Mumbai University)
[Knowledge is Nectar]
ACADEMIC YEAR 2024-25
Class: F.Y. B. Tech. Semester: II Course: PSOOP(Java)
Course In charge: Nikahat Mulla
____________________________________________________________________
_______
List of Problems for practice-Set I -Encapsulation: Objects &
Classes, Constructors
1. Write a program to find the sum of the first two digit of two numbers. Use the concept of
classes and objects.
2. Create class Product. Using a method, set its values for product name, prize, brand.
Write another method to display the GST needed to pay on the current object. 3. Write a
program to design a Class cycler with name, age, no. of marathon attended
and calculate the average speed of each cycler. use appropriate data for cycler if
missing.
4. A painter is given a contract to paint a wall. He goes and measures with a meter tape.
However he makes further calculations in foot. Cost of painting per square foot is Rs. 10.
Find the amount to be paid to him for painting. A constructor is used to set the length and
breadth of the wall. Use an object as a parameter. Note: 1 meter= 3.28 feet.
5. Create a Class Student containing the student's name, marks of 5 papers of a subject
(use integer array).
Use parameterized constructors to initialize values of marks and name.
Write a method:
1. To find average of 5 papers
2. To display the name of the student, marks of 5 papers, and average.