#include #include using namespace std; class BankAccount { private: string owner; double balance; public: BankAccount(string name, double initial_balance) : owner(name), balance(initial_balance) {} void deposit(double amount) { if (amount > 0) { balance += amount; cout << "$" << amount << " deposited successfully!\n"; } else { cout << "Invalid deposit amount.\n"; } } void withdraw(double amount) { if (amount > 0 && amount <= balance) { balance -= amount; cout << "$" << amount << " withdrawn successfully!\n"; } else { cout << "Insufficient funds or invalid amount.\n"; } } void check_balance() const { cout << "Your current balance is: $" << balance << "\n"; } }; int main() { string name; double initial_balance; cout << "$$$$ Welcome to The National Bank of Jerry! $$$$\n"; cout << "What is your name? : "; getline(cin, name); //getline for multiple words in name (first, last) cout << "Enter initial deposit: $"; cin >> initial_balance; cout <<" \n"; BankAccount account(name, initial_balance); int choice; do { cout << "\t MENU\t\n\n"; cout << "1.\tCheck Balance\n"; cout << "2.\tDeposit Money\n"; cout << "3.\tWithdraw Money\n"; cout << "4.\t Exit\n"; cout << "Enter your choice: "; cin >> choice; if (choice == 1) { account.check_balance(); } else if (choice == 2) { double amount; cout << "Enter deposit amount: $"; cin >> amount; account.deposit(amount); } else if (choice == 3) { double amount; cout << "Enter withdrawal amount: $"; cin >> amount; account.withdraw(amount); } else if (choice == 4) { cout << "Thank you for choosing the National Bank of Jerry! Have a great day! \n"; } else { cout << "Invalid choice. Please try again.\n"; } } while (choice != 4); return EXIT_SUCCESS; }