-
May 10th, 2012, 07:26 PM
#1
Beginner needs help with bank atm program, please!!
By the grace of nice programmers, I ask for help. I learn mostly from example, but I can't figure out how to get started.
For my class I need to write a source code to simulate an ATM.
Basically starting with a balance of $5000.
Entering a user-input loop, give 4 choices
(withdraw, deposit, show balance, and quit)
If anyone could help me with going about this, maybe with just one of them (withdraw), that'd be great. And before you suggest using all kinds of advanced methods, I'm suppose to stay in the range of what we've learned so far. Here's how i started it:
Code:
------------------------------------------------------------
#include <iostream>
#include <string>
using namespace std;
int main ()
{
//declare variables
int acct_bal = 5000;
int choice;
double withdraw, deposit, balance ;
cout << "Your account balance is $" << acct_bal
<< "\n\nPress (W) if you'd like to withdraw money. \n"
"Press (D) if you'd like to deposit money. \n"
"Press (B) to show balance. \n"
"Press (Q) to exit your account. \n";
cin >> choice;
if ( choice== "D" || choice== "d" )
{
cout << "enter deposit amount";
return 0;
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|