Create a program to implement a simple text-based banking system with deposit and withdrawal functions.
HardProblem 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;
}
Input
Account account; account.deposit(100);
Expected Output
Balance: 100 Balance after withdrawal: 50