0% found this document useful (0 votes)
5 views1 page

Java Basic Problrm Statement

The document outlines a series of Java programming tasks that involve creating various classes such as Person, Rectangle, Circle, Employee, TrafficLight, Student, Library, Airplane, and Restaurant. Each class has specific attributes and methods to perform operations like calculating areas, updating salaries, managing collections, and handling reservations. The tasks aim to enhance object-oriented programming skills in Java.

Uploaded by

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

Java Basic Problrm Statement

The document outlines a series of Java programming tasks that involve creating various classes such as Person, Rectangle, Circle, Employee, TrafficLight, Student, Library, Airplane, and Restaurant. Each class has specific attributes and methods to perform operations like calculating areas, updating salaries, managing collections, and handling reservations. The tasks aim to enhance object-oriented programming skills in Java.

Uploaded by

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

1.

Write a Java program to create a class called "Person" with a name and
age attribute. Create two instances of the "Person" class, set their
attributes using the constructor, and print their name and age.
2. Write a Java program to create a class called "Rectangle" with width
and height attributes. Calculate the area and perimeter of the rectangle.
3. Write a Java program to create a class called "Circle" with a radius
attribute. You can access and modify this attribute. Calculate the area
and circumference of the circle.
4. Write a Java program to create a class called "Employee" with a name,
job title, and salary attributes, and methods to calculate and update
salary.
5. Write a Java program to create class called "TrafficLight" with attributes
for color and duration, and methods to change the color and check for
red or green.
6. Write a Java program to create a class called "Student" with a name,
grade, and courses attributes, and methods to add and remove
courses.

7. Write a Java program to create a class called "Library" with a collection


of books and methods to add and remove books.
8. Write a Java program to create a class called "Airplane" with a flight
number, destination, and departure time attributes, and methods to
check flight status and delay.
9. Write a Java program to create a class called "Restaurant" with
attributes for menu items, prices, and ratings, and methods to add and
remove items, and to calculate average rating.
10. Write a Java program to create a class with methods to search for
flights and hotels, and to book and cancel reservations.

You might also like