Write a simple ATM program. Ask the user to enter their account number, and then print their beginning balance. (Just make one up). Then ask them if they want to make a deposit or a withdrawal. Depending on their selection, call a function to perform the action that they wish. Then print the new balance. They should be able to do as many transactions as they wish, so use iteration here.

Below is a small perl program which does the job. You may not know perl, but it should be possible to figure out what it's doing.

It does not validate input as a number, but it does illustrate some of the possible gotchas, and what can be done.

------------------------------------

print "Enter Account Number: ";
$acct = <STDIN>;

$bal = 500 + rand(500); #random balance from 500 to 1000
$bal = int($bal*100)*.01; #restrict to 2 decimal places
printf "Current Balance: \$%4.2f\n",$bal;

while (1) {
print "Deposit(D) or Withdrawal(W) or Quit(Q) ? ";
until (($dw = <STDIN>) =~ /^\s*[dw]\s*$/i) { # make sure onlt D or W is entered
exit if $dw =~ /^q/i;
chomp $dw;
print "\"$dw\" is not a valid choice.\n";
print "Deposit(D) or Withdrawal(W)? ";
}
$dw =~ s/\s+//g; # strip white space
$dw = "\U$dw"; # convert to upper case

if ($dw eq "D") {
$bal += update("Deposit");
} else {
$bal -= update("Withdrawal",$bal);
}

printf "New balance: \$%4.2f\n",$bal;
print "\nAnother transaction [Y]? ";
$yn = <STDIN>;
last unless $yn =~ /^y?\s*$/i; #exit unless Y or <cr> entered
}

# Get deposit/withdrawal amount.
# This function does not validate input as number
sub update {
my ($dw,$cb) = @_; # get D/W and current balance
print "Amount of $dw: \$";
$amt = <STDIN>;
return $amt if $dw eq "Deposit"; # allow any deposit
while ($amt > $cb) {
printf "You cannot withdraw \$%4.2f -- balance is only \$%4.2f
Please enter an amount less than \$%4.2f: \$",$amt,$cb,$cb;
$amt = <STDIN>;
}
return $amt;
}

Would you like to share with us what you have done so far, and what problems you are encountering, if any?

It is also not clear which language should be used to write this program.

Here is a step-by-step guide to creating a simple ATM program in Python:

1. Start by defining a function to perform the deposit operation. This function will take the current balance and the deposit amount as parameters, and return the updated balance. It should add the deposit amount to the balance.

```python
def deposit(balance, amount):
balance += amount
return balance
```

2. Next, define a function to perform the withdrawal operation. This function will also take the current balance and the withdrawal amount as parameters, and return the updated balance. It should subtract the withdrawal amount from the balance.

```python
def withdrawal(balance, amount):
balance -= amount
return balance
```

3. Now, let's implement the main part of the program. Start by asking the user to enter their account number and storing it in a variable.

```python
account_number = input("Enter your account number: ")
```

4. Generate and store a random balance for the account. You can use the `random` module in Python for this.

```python
import random

beginning_balance = random.randint(1000, 10000)
print("Your beginning balance is:", beginning_balance)
```

5. Now, use a loop to allow the user to perform multiple transactions. Inside the loop, ask the user whether they want to make a deposit or a withdrawal.

```python
while True:
transaction_type = input("Do you want to make a deposit or a withdrawal? (Enter 'deposit' or 'withdrawal'): ")
```

6. Based on the user's input, call the respective function to perform the deposit or withdrawal operation. Update the balance accordingly.

```python
if transaction_type == "deposit":
amount = float(input("Enter the deposit amount: "))
beginning_balance = deposit(beginning_balance, amount)
elif transaction_type == "withdrawal":
amount = float(input("Enter the withdrawal amount: "))
beginning_balance = withdrawal(beginning_balance, amount)
```

7. After each transaction, print the new balance.

```python
print("Your new balance is:", beginning_balance)
```

8. Add an option for the user to exit the program. Inside the loop, ask the user if they want to continue. If they enter 'no', break out of the loop.

```python
continue_transaction = input("Do you want to continue? (Enter 'yes' or 'no'): ")
if continue_transaction == "no":
break
```

Putting it all together, here's the complete code:

```python
import random

def deposit(balance, amount):
balance += amount
return balance

def withdrawal(balance, amount):
balance -= amount
return balance

account_number = input("Enter your account number: ")
beginning_balance = random.randint(1000, 10000)
print("Your beginning balance is:", beginning_balance)

while True:
transaction_type = input("Do you want to make a deposit or a withdrawal? (Enter 'deposit' or 'withdrawal'): ")

if transaction_type == "deposit":
amount = float(input("Enter the deposit amount: "))
beginning_balance = deposit(beginning_balance, amount)
elif transaction_type == "withdrawal":
amount = float(input("Enter the withdrawal amount: "))
beginning_balance = withdrawal(beginning_balance, amount)

print("Your new balance is:", beginning_balance)

continue_transaction = input("Do you want to continue? (Enter 'yes' or 'no'): ")
if continue_transaction == "no":
break
```

I hope this helps! Let me know if you have any further questions.

To write a simple ATM program, you can create a function for each action (deposit and withdrawal) and use loops to allow the user to perform multiple transactions. Here is a sample code in Python:

```python
# Define starting balance
balance = 1000

# Function for deposit
def deposit(amount):
global balance
balance += amount

# Function for withdrawal
def withdrawal(amount):
global balance
balance -= amount

# Main program
def atm_program():
# Get account number
account_number = input("Enter your account number: ")

# Print beginning balance
print("Your beginning balance is:", balance)

while True:
# Ask for transaction type
transaction_type = input("What would you like to do? (deposit/withdrawal/quit): ")

if transaction_type == "deposit":
amount = float(input("Enter the deposit amount: "))
deposit(amount)
print("Deposit of", amount, "successful.")
elif transaction_type == "withdrawal":
amount = float(input("Enter the withdrawal amount: "))
withdrawal(amount)
print("Withdrawal of", amount, "successful.")
elif transaction_type == "quit":
print("Thank you for using the ATM.")
break
else:
print("Invalid transaction type. Please try again.")
continue

# Print new balance
print("Your new balance is:", balance)

# Call the program
atm_program()
```

This program starts by asking the user to enter their account number, followed by printing their beginning balance. Then, it prompts the user for the transaction type (deposit, withdrawal, or quit) and performs the corresponding action using the appropriate function.

After each transaction, it prints the new balance. The user can keep performing transactions until they choose to quit by entering "quit".