having problems on what my output would be

here's my code.
my problem is, this program should output also the NEW CALCULATED BALANCE, however, i can't edit my main neither the function prototypes.

# include <iostream.h>
#include<stdlib.h>

int fSelectMenu( )
{
int select;
cout<<"Select your Transaction\n"<<endl;
cout<<"1 - Deposit \n"
<<"2 - Withdraw \n"
<<"3 - Balance Inquiry \n"
<<"4 - Quit \n"
<<"\n"
<<"Enter Option: ";
cin>>select;

return select;
}
void fDeposit(double&)
{
double balance, deposit;
cout<<"\nDEPOSIT\n";
cout<<"Enter amount: ";
cin>>deposit;
if(deposit<100)
{
cout<<"INVALID"<<endl;
cout<<"You can't deposit less than 100.00"<<endl;
}
else
{
balance = balance + deposit;
cout<<"You deposited "<<deposit<<endl;
}
}

void fWithdraw(double&)
{
double withdraw, balance;
cout<<"\nWITHDRAW\n";
cout<<"Enter amount: ";
cin>>withdraw;
balance = balance - withdraw;
if(withdraw<200.00 && balance<500.00)
{
cout<<"INVALID"<<endl;
cout<<"You can't withdraw less than 200.00 or Your remaining balance will be less than 500.00"<<endl;
}
else
{
cout<<"You withdrew "<<withdraw<<endl;
}
}

void fBalanceInquiry (double)
{
cout<<"\nBALANCE INQUIRY\n";
}

void fQuit( )
{
cout<<"\n----QUIT----\n";
}

char fTryAgain()
{
char ch;
cout<<"Would you like to do another transaction?[y/n]"<<endl;
cin>>ch;
ch = toupper(ch);

return ch;
}

void main()
{
double balance=10000.00;
char ch;
int select;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
do
{
select = fSelectMenu ();
switch (select)
{
case 1:
fDeposit (balance);
break;
case 2:
fWithdraw (balance);
break;
case 3:
fBalanceInquiry(balance);
break;
case 4:
fQuit();
default:
cerr<<"Invalid selection\n";
}
cout<<"Your remaining Balance: "
<<balance<<endl<<endl;
ch = fTryAgain ();
system("cls");
}while (ch=='Y' || ch == 'y');
}
¿why do you ask for parameters if you don't intend to use them?

> i can't edit my main
main() must return int
Topic archived. No new replies allowed.