Write a program using any object-oriented language (e.g., C++ / Java / Python) to represent a Bank Account. Your program should include: A class…
Write a program using any object-oriented language (e.g., C++ / Java / Python) to represent a Bank Account. Your program should include:
- A class BankAccount with data members for account holder's name, account number, and balance.
- Member functions to deposit() money, withdraw() money (ensuring sufficient balance), and display() account details.
Demonstrate the concept of encapsulation by keeping data members private and providing appropriate public methods for accessing and modifying them.
From the Combined Bank Senior Officer October 2025 – Written exam, question 42 of 50.
More from this paper
- Previous: Write a structured program (in C or Python) that takes an integer input n and prints the sum of all even numbers from 1 to n.
- Next: Explain the difference between direct, immediate, and register addressing modes in the 8086 microprocessor.
- All questions in Combined Bank Senior Officer October 2025 – Written