I can't get this acceptinput function to work for the life of me, what am I doing wrong, all Ii get is error after error.
Thanks
John
Code:
#include <iostream.h>
#include <iomanip.h>
float current_bank_balance, total_amount_checks_written;
float total_amount_deposits;
float ending_balance, monthly_charges, dividends, final_balance;
float total_monthly_charges = 0, total_dividends = 0;
int loopcount;
int main ( )
{
//Print out the heading line
cout << "\t\t\t\t\t\tFirst Bank of YourName\n\n";
//Start the loop
for(loopcount=1; loopcount < 4; loopcount++)
{
// Bring the input information in
acceptinput ();
//compute
ending_balance = current_bank_balance + total_amount_deposits - total_amount_checks_written;
if(ending_balance < 0)
{
monthly_charges = 33;
dividends = 0;
}
if(ending_balance >= 0 && ending_balance < 500)
monthly_charges = 25;
if(ending_balance >= 500)
monthly_charges = 8;
if(ending_balance >= 0 && ending_balance <= 500)
dividends = 0.02 * ending_balance;
if(ending_balance > 500)
dividends = 0.035 * ending_balance;
final_balance = ending_balance - monthly_charges + dividends;
//accumulate totals
total_monthly_charges = total_monthly_charges + monthly_charges;
total_dividends = total_dividends + dividends;
//print a detail line
cout.setf(ios::fixed);
cout << setprecision(2) << "\n\t\t\t\t\tBeginning Balance $ " << current_bank_balance << "\n";
cout << "\t\t\t\t\tDeposits + " << total_amount_deposits << "\n";
cout << "\t\t\t\t\tLess Checks - " << total_amount_checks_written << "\n";
cout << "\t\t\t\t\tEnding Balance $ " << ending_balance << "\n";
cout << "\t\t\t\t\tMonthly Charges - " << monthly_charges << "\n";
cout << "\t\t\t\t\tDividend + " << dividends << "\n";
cout << "\t\t\t\t\tFinal Balance $ " << final_balance << "\n\n";
} //end loop
//Print Totals
cout << " Totals:\n";
cout << "\t\tMonthly Charges: $" << total_monthly_charges << "\n";
cout << "\t\tDividends: $" << total_dividends;
return 0;
}
void acceptinput()
{
cout << "Enter Beginning Balance: ";
cin >> current_bank_balance;
cout << "Enter total amount of deposits: ";
cin >> total_amount_deposits;
cout << "Enter total amount of checks: ";
cin >> total_amount_checks_written;
}