Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a program to implement a simple text-based banking system with deposit and withdrawal functions.

Hard

Problem Statement

Create a program to implement a simple text-based banking system with deposit and withdrawal functions.

Sample Input

Account account; account.deposit(100);

Sample Output

Balance: 100
Balance after withdrawal: 50

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <iostream> class Account { private: double balance; public: Account(); void deposit(double amount); void withdraw(double amount); double getBalance(); }; int main() { // Logic to demonstrate banking functions return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
Account account; account.deposit(100);
Expected Output
Balance: 100
Balance after withdrawal: 50