0
到另一個程序。這是一個模擬銀行賬戶的程序。我需要幫助顯示餘額,提取和存款。如何在退出/存款後顯示最終餘額?銀行賬戶計劃構建和入門的問題
#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;
}
我剛剛更新了我的代碼上面...我如何得到它來計算最終平衡? –
你告訴我!畢竟,這是你的任務。 –
好的,謝謝@Jonathon Reinhart的幫助。 –