// Lucky ATM.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <fstream>
usingnamespace std;
void main();
int menu();
double currentBalance( double balance);
double withdraw();
double deposit ();
float payment();
int option;
bool unscreen();
void main()
{
int menu;
cout<<" \n---------------------------------------------------"<<endl;
cout<<"If you require help, press 1 for unscreen help. \n"<<endl;
cout<<"Please choose from the following option \n"<<endl;
cout<<"Press 2 for to check balance."<<endl;
cout<<"Press 3 for to make a Withdraw."<<endl;
cout<<"Press 4 for to make a Deposit."<<endl;
cout<<"Press 9 to exit"<<endl;
cin>>menu;
switch(menu)
{
case 1:
unscreen();
main ();
case 2:
currentBalance(balance);
main ();
case 3:
withdraw();
main ();
case 4:
deposit();
main ();
case 9:
exit(0);
default:
cout<<"You did not choose from the menu options, reloading the menu!"<<endl;
main();
}
}
double currentBalance(double balance)
{
double balance = 0;
ifstream readfile;
readfile.open("renatofile.txt");
char output [100];
if (readfile.is_open()) {
while(!readfile.eof())
{
readfile>>output;
}
}
readfile.close();
balance = atof(output);
return balance;
}
The compiler is telling you that you are trying to pass a variable called 'balance' into currentBalance on that line, but you haven't ever defined such a variable.
Also, you shouldn't be calling main ever; use a loop if you want to repeat things.
// Lucky ATM.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <fstream>
usingnamespace std;
void main();
int menu();
double currentBalance( double balance);
double withdraw();
double deposit ();
float payment();
int option;
bool unscreen();
void main()
{
int menu;
cout<<" \n---------------------------------------------------"<<endl;
cout<<"If you require help, press 1 for unscreen help. \n"<<endl;
cout<<"Please choose from the following option \n"<<endl;
cout<<"Press 2 for to check balance."<<endl;
cout<<"Press 3 for to make a Withdraw."<<endl;
cout<<"Press 4 for to make a Deposit."<<endl;
cout<<"Press 9 to exit"<<endl;
cin>>menu;
switch(menu)
{
case 1:
unscreen();
main ();
case 2:
currentBalance(balance);
main ();
case 3:
withdraw();
main ();
case 4:
deposit();
main ();
case 9:
exit(0);
default:
cout<<"You did not choose from the menu options, reloading the menu!"<<endl;
main();
}
}
double currentBalance(double balance)
{
double balance = 0;
ifstream readfile;
readfile.open("renatofile.txt");
char output [100];
if (readfile.is_open()) {
while(!readfile.eof())
{
readfile>>output;
}
}
readfile.close();
balance = atof(output);
return balance;
}
That error is from the linker saying that it can't find the function double which you declared on line 20, but never defined. You'll need to define it so the linker can find it.