[go: up one dir, main page]

0% found this document useful (0 votes)
3 views3 pages

Practice Questions

The document outlines practice questions for various programming concepts using object-oriented programming principles. It includes tasks for creating classes and implementing features such as encapsulation, inheritance, polymorphism, and abstraction across different systems like bank account management, student grading, library management, and more. Each task specifies the required attributes and methods to be implemented for the respective system.

Uploaded by

saniyachandere12
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)
3 views3 pages

Practice Questions

The document outlines practice questions for various programming concepts using object-oriented programming principles. It includes tasks for creating classes and implementing features such as encapsulation, inheritance, polymorphism, and abstraction across different systems like bank account management, student grading, library management, and more. Each task specifies the required attributes and methods to be implemented for the respective system.

Uploaded by

saniyachandere12
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
You are on page 1/ 3

🔸 1.

Bank Account Management System


PRACTICE QUESTIONS

Concepts: Class, Object, Encapsulation, Method Overloading​


Task:
●​ Create a BankAccount class with fields like accountNumber, accountHolderName,
and balance.
●​ Provide methods to deposit, withdraw, and check balance.
●​ Overload the deposit method to accept either cash or cheque.​

🔸 2. Student Grade System


Concepts: Encapsulation, Constructor Overloading​
Task:
●​ Create a Student class with name, roll number, and marks in 3 subjects.
●​ Use constructor overloading to initialize students with different data.
●​ Provide a method to calculate percentage and grade.​

🔸 3. Library Management using Inheritance


Concepts: Inheritance​
Task:
●​ Create a base class LibraryItem with attributes like title, author, and ID.​

●​ Derive classes Book, Magazine, and DVD from it with their specific properties.​

●​ Display details using an overridden method.​

🔸 4. Vehicle Booking System


Concepts: Polymorphism (Method Overriding)​
Task:
●​ Create a base class Vehicle with a method bookRide().​

●​ Extend this class into Car, Bike, and Bus, each overriding bookRide() to show
specific booking logic.​

●​ Call the method using a base class reference.​

🔸 5. Shape Area Calculator


Concepts: Abstraction (Abstract Class or Interface)​
Task:
●​ Create an abstract class or interface Shape with a method calculateArea().​

●​ Implement this method in Circle, Rectangle, and Triangle classes.​

●​ Create objects dynamically and print their areas.​

🔸 6. Employee Salary System


Concepts: Class, Static Keyword, Inheritance​
Task:
●​ Create a base class Employee with static counter to track total employees.​

●​ Extend classes like Manager, Developer, and Tester.​

●​ Calculate salary based on role using a method.​

🔸 7. Online Shopping Cart


Concepts: Encapsulation, Polymorphism, ArrayList​
Task:
●​ Create a Product class with attributes like name, price, and category.​

●​ Allow adding/removing products to/from a cart.​

●​ Display total bill, including discounts for specific categories.​

🔸 8. Hospital Management System


Concepts: Class Hierarchies, Abstraction, Inheritance​
Task:
●​ Create abstract class Person with name and age.​

●​ Extend it into Doctor, Nurse, and Patient classes.​

●​ Implement methods like diagnose(), admitPatient().​

🔸 9. College Admission System


Concepts: Encapsulation, Constructor Overloading, Static​
Task:
●​ Create a class Applicant with details like name, percentage, course applied.​

●​ Use constructor overloading for different application types.​


●​ Track total applicants using a static variable.​

🔸 10. E-Ticket Reservation System


Concepts: All major OOP principles​
Task:
●​ Design classes like User, Ticket, Train, BookingSystem.​

●​ Use inheritance for different transport types (Train, Flight, Bus).​

●​ Use polymorphism for booking logic and abstraction for payment method.​

You might also like