exercises C++
exercises C++
int main() {
double balance = 0.0;
int choice;
double amount;
while (true) {
cout << "1. Check Balance" << endl;
cout << "2. Deposit Funds" << endl;
cout << "3. Withdraw Funds" << endl;
cout << "4. Exit" << endl;
balance += amount;
cout << "Deposited: $" << amount << ". Balance: $" << balance << endl;
}
else if (choice == 3) {
if (balance <= 0) {
cout << "Error" << endl;
}
else {
cout << "Withdrawal amount: $";
cin >> amount;