进入另一个程序。这是一个模拟银行账户的程序。我在显示余额、取款和存款方面需要帮助。我如何在提款/存款后显示最终余额?
#include <iostream>
#include <string>
#include "BACCOUNT.H"
using namespace std;
int main ()
{
double amount = 0.0;
double withrdraw = 0.0;
double deposit = 0.0;
string name;
double startamount = 100.00;
double balance = 0.0;
cout << "name: ";
cin >> name;
cout << "initial balance: " << startamount <<endl;
cout << "deposit? ";
cin >> amount;
cout << "withdraw? ";
cin >> amount;
cout << "balance for " << name << " is " << balance << endl;
system ("pause");
return 0;
}