so my project is due tomarrow and im stuck i need to some help. This is what i have it came up with some errors and i need to finish it. The conditions are TOTAL BALANCE and need to withdraw only multipule of 20

// This is a program that is an ATM.
#include <iostream>
#include <cstdlib>
#include <iomanip>
using namespace std;

// These are function prototypes
void welcome();
void menu();
double amountDeposit ();
void amountWithdrawal();
double finalBalance ();
void exit();

// This the main function that will operate all other funtions.
int main ()

{
char choice;
double deposit,totalBalance;
	  
welcome();
do 
{

menu();
cin >> choice;
while (choice < 'A' || choice > 'C')
{
cout << " Please make a choice in the range";
cout << " of A through C:";
cin >> choice;
}
switch (choice)
{
case 'a' :
case 'A' : exit();
break;
case 'b' :
case 'B' : amountDeposit();
		   cout << "You deposited $ " << amountDeposit() << "." <<  finalBalance () << "." << endl;
           break;
case 'c' :	
case 'C' : amountWithdrawal();
break;
}
} while ( choice != 'A');




return 0;
}


// Function is the welcome menu.
void welcome()
{ 
cout << "- - - - - - - - - - - - - - - - - - -" << endl;
cout << "-	 Welcome to DDJ'S ATM Servies    -" << endl;
cout << "-	Please follow the instructions   -" << endl;
cout << "-	 to access you account           -" << endl;
cout << "- - - - - - - - - - - - - - - - - - -" << endl;
system ("PAUSE");
system ("cls");

}

// Function is the welcome Main menu that gives you the choices.
void menu()

{
cout << "What would you like to do?" << endl;
cout << "A. Exit the program" << endl;
cout << "B. Make a deposit" << endl;
cout << "C. Make a withdrawal" << endl;

}


// Function will run the deposits.
double amountDeposit(double deposit)

{
	
cout << "How much would you like to deposit? $"; 
cin >> deposit;
if ( deposit >=1000)
{
	cout << "Only able Deposit Maximum of $1000.00 Try Again" << endl;
	cin >> deposit;
}

 return (deposit);
system ("PAUSE");
system ("cls");

}

// Function will run the withdrawals.
void amountWithdrawal()

{ 
double withdrawal;
cout << "How much would you like to withdrawal? $";
cin >> withdrawal;

if ( withdrawal >=500)
{
	cout << "Only able withdrawal Maximum of $500.00. Try Again" << endl;
	cin >> withdrawal;
}
if ( withdrawal= withdrawal % 20)
{
	cout << "Withdrawal Must be a multiple of $20. Try Again" << endl;
	cin >> withdrawal;
}


system ("PAUSE");
system ("cls");
}

double finalBalance (double totalBalance)
{
	double balance = 800,
	       totalbalance;
	totalBalance = balance + amountDeposit();
	return (totalbalance);
}
	

// This is the exit funtion
void exit ()

{
cout << "Please come again.\n";
}

Close on the code tags. You forgot an opening bracket.

[code]

// code here

[/code]

What error messages do you get, and what are the corresponding line numbers?

There is a bit of a syntactical error in your amountWithdrawl function.

You have:

if ( withdrawal=withdrawal % 20)

I think you mean:

if ( withdrawal!=withdrawal % 20)

or

if ( withdrawal==withdrawal % 20)

also, you might want to think about that line for a bit...the % opperator returns the remainder of a division. if I wanted to withdraw $20, it wouldn't work correctly because according to the program, this is what you'd be trying to do:

if ( 20(== or !=)0)

So basically it will return true if the amount is not a multiple of 20, and false if it is; depending on what you meant to put there; either way it doesn't work.

you're on the right track, but try comparing withdrawal%20 to a constant instead of a variable.

// This is a program that is an ATM.
#include <iostream>
#include <cstdlib>
#include <iomanip>
using namespace std;

// These are function prototypes
void welcome();
void menu();
double amountDeposit ();
void amountWithdrawal();
double finalBalance ();
void exit();

// This the main function that will operate all other funtions.
int main ()

{
char choice;
double deposit,totalBalance;
	  
welcome();
do 
{

menu();
cin >> choice;
while (choice < 'A' || choice > 'C')
{
cout << " Please make a choice in the range";
cout << " of A through C:";
cin >> choice;
}
switch (choice)
{
case 'a' :
case 'A' : exit();
break;
case 'b' :
case 'B' : amountDeposit();
		   cout << "You deposited $ " << amountDeposit() << "." <<  finalBalance () << "." << endl;
           break;
case 'c' :	
case 'C' : amountWithdrawal();
break;
}
} while ( choice != 'A');




return 0;
}


// Function is the welcome menu.
void welcome()
{ 
cout << "- - - - - - - - - - - - - - - - - - -" << endl;
cout << "-	 Welcome to DDJ'S ATM Servies    -" << endl;
cout << "-	Please follow the instructions   -" << endl;
cout << "-	 to access you account           -" << endl;
cout << "- - - - - - - - - - - - - - - - - - -" << endl;
system ("PAUSE");
system ("cls");

}

// Function is the welcome Main menu that gives you the choices.
void menu()

{
cout << "What would you like to do?" << endl;
cout << "A. Exit the program" << endl;
cout << "B. Make a deposit" << endl;
cout << "C. Make a withdrawal" << endl;

}


// Function will run the deposits.
double amountDeposit(double deposit)

{
	
cout << "How much would you like to deposit? $"; 
cin >> deposit;
if ( deposit >=1000)
{
	cout << "Only able Deposit Maximum of $1000.00 Try Again" << endl;
	cin >> deposit;
}

 return (deposit);
system ("PAUSE");
system ("cls");

}

// Function will run the withdrawals.
void amountWithdrawal()

{ 
double withdrawal;
cout << "How much would you like to withdrawal? $";
cin >> withdrawal;

if ( withdrawal >=500)
{
	cout << "Only able withdrawal Maximum of $500.00. Try Again" << endl;
	cin >> withdrawal;
}
if ( withdrawal= withdrawal % 20)
{
	cout << "Withdrawal Must be a multiple of $20. Try Again" << endl;
	cin >> withdrawal;
}


system ("PAUSE");
system ("cls");
}

double finalBalance (double totalBalance)
{
	double balance = 800,
	       totalbalance;
	totalBalance = balance + amountDeposit();
	return (totalbalance);
}
	

// This is the exit funtion
void exit ()

{
cout << "Please come again.\n";
}

Don't just post the code. We have no idea whether you have changed anything, whether you have looked at the other posts, whether you've fixed anything, what the errors are, etc.

See post 3. You've either not see the advice, don't understand it, or rejected it because it doesn't look like you have followed it.

Lines 124 to 128 are definitely wrong. Look at your capitalization. If you don't use a variable, delete it. We have no idea whether you intend different levels of capitalization or whether that's on accident.

Does it compile? What's the question?

c++ is case sensitive when it comes to variables, so exaMple would be a different variable than example.

What you did in the finalBalance function, is you passed in a variable totalBalance, the created a completely new variable totalbalance, modified totalBalance, then returned totalbalance.

So what you're returning is going to be garbage because you never initialized totalbalance; in fact, you don't even need it; you can do the calculation with just totalBalance alone.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.