I'm way out of my league right now!!! I have to code, build and execute an Automated Teller Machine Menu-Driven Console. The output must include the following:
Welcome to the Happy Day Bank Automated Teller Machine!
1. Check balance
2. Make withdrawal
3. Make deposit
4. View account information
5. View statement
6. View bank information
7. Exit
The result of choosing #1 will be the following:
Current balance is: $2439.45
The result of choosing #2 will be the following:
How much would you like to withdraw? $200.50
The result of choosing #3 will be the following:
How much would you like to deposit? $177.32
The result of choosing #4 will be the following:
Name: (First and last name goes here)
Account Number: 1234554321
The result of choosing #5 will be the following:
01/01/11 - McDonald’s - $6.27
01/15/11 - Kwik Trip - $34.93
02/28/11 - Target - $124.21
The result of choosing #6 will be the following:
Happy Day Bank, established 2011
(123) 456-7890
12345 1st St.
Someplace, NJ 12345
The result of choosing #7 will be the following:
*Exit the program - terminate console application.
OP: I suggest you start by googling for C++ ATM code and seeing what you can adapt for your uses and the general way these programs tackle their problems
That's what I've been doing. I think I have some good stuff to work with so far. I'm at work so I can't plug it into VS yet to see where how it looks. I don't want to post my code on here unformatted.
Line 95: The else is not associated with an if statement.
Line 80: case has no break.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
So I have my code working, but I can only input once. After I get the result I want, nothing happens. How do I get it to allow me to input another option?
The only part I would change is to put the close of the do while loop after line 96. And you will have to add some code in order to end the while loop. Something like this might work:
1 2 3 4 5 6
if (cont)
{
cout << "\n ANOTHER TRANSACTION? Y/N ";
cin >> answer;
}
if (toupper(answer) == 'N') cont = false;
with "cont" defined as a bool and set to true when it was defined. I added this as a fix to work with case 7 in the switch where I also set "cont" to false.