Question

In: Computer Science

You will write a program using Python that simulates an Automatic Teller Machine (ATM). For this...

You will write a program using Python that simulates an Automatic Teller Machine (ATM). For this program, your code can have user defined functions (but not required), the program must not call on any external functions or modules to handle any of the input, computational, and output requirements.

Requirements:

There is a customer with the following credential and can only access the system if the Access Code is correct:

• Name: Peter Parker, Access Code: 2222

• When the program starts, the customer has two account types. That is a Checking Account and Savings Account with balances starting with $1000 for Checking and $2000 for Savings.

• When the program starts, customer credentials and accounts starting amounts must be processed and stored before the customer interacting with the system.

Customer Main Choices (Sub-menu choices based on the type of transactions)

1) View Balance

2) Deposit

3) Withdraw

4) Exit

Account Processing Restrictions:

a) The balances of each account type must be updated base on selected customer choices.

b) The customer can choose to withdraw from the Checking and Savings accounts but can only withdraw if there is enough money in the accounts to meet the withdrawal request. When making a Withdraw, the customer must be presented with an appropriate message to show the withdrawing account's balance before completing such a transaction.

c) When making a withdrawal from the Saving account, a fee is charged and reflected in the Saving account (0.02% of the total amount transfer). The fee must be displayed as part of the output when the customer performs this operation.

d) When the request to View Balance, the appropriate output must display the balance for each account type and the accounts' total balance.

e) The system will not accept a deposit > $500.

f) The customer cannot deposit, withdraw, or transfer partial currency (ex: $100 is valid. $100.50 is invalid).

Additional Requirements:

1) Appropriate introduction statements (s) (output) to the customer for the purpose and options when the program starts

2) Appropriate statement (s) to the customer to capture all input requirements as per program requirements

3) Properly tested to valid customer/admin input. Also, appropriate and detail messages for invalid input.

4) Appropriate formatted output

5) The program runs in a continuous loop until the admin chooses to quit. For this program, we will assume that customers will not use the quit option. It will be used to test your program thoroughly. Hence, include the quit option, but do not make it evident as one of the listed customer choices.

6) Meets correct code format and structure requirements

Solutions

Expert Solution


def start():
  
global checking_bal, savings_bal
print('\nAccount Holder: Peter Parker')
print('Access Code: 2222')
print('Checking Account balance: $',checking_bal)
print('Savings Account balance: $',savings_bal)
print('\nPress:\na) v for View Balance\nb) d for Deposit\nc) w for Withdraw\nd) e for Exit')
choice = input()
  
if(choice == 'v' or choice == 'V'):
print('Account Holder: Peter Parker')
print('Access Code: 2222\n')
print('Checking Account balance: $',checking_bal)
print('\nSavings Account balance: $',savings_bal)
print('\nTotal balance: $', checking_bal+savings_bal)
print('\n\n\n')
start()
  

elif(choice == 'd' or choice == 'D'):
  
while(True):
print('\nPress:\n S to deposit in savings account \n C to deposit in checking account')
account = input()
if( account == 'S' or account == 's'):
while(True):
deposit_amount = input('Enter amount to be deposited: $')
if('.' in deposit_amount and int(deposit_amount[deposit_amount.index('.')+1:])>0):
print('Enter amount without any decimal value')
continue
deposit_amount=int(deposit_amount)
if(deposit_amount<=500):
savings_bal = savings_bal + deposit_amount
print('--'*10)
print('Amount deposited successfully')
print('--'*10)
start()
else:
print('Enter a amount less than $500')
elif( account == 'c' or account == 'C'):
while(True):
deposit_amount = input('Enter amount to be deposited: $')
if('.' in deposit_amount and int(deposit_amount[deposit_amount.index('.')+1:])>0):
print('Enter amount without any decimal value')
continue
deposit_amount=int(deposit_amount)
if(deposit_amount<=500):
checking_bal = checking_bal + deposit_amount
print('--'*10)
print('Amount deposited successfully')
print('--'*10)
start()
else:
print('Enter a amount less than $500')
else:
print('Enter correct option')
continue

  
elif(choice == 'w' or choice == 'W'):
  
while(True):
print('\nPress:\n S to withdraw from savings account \n C to withdraw from checking account')
account = input()
if( account == 'S' or account == 's'):
while(True):
withdraw_amount = input('Enter amount to withdraw: $')
if('.' in withdraw_amount and int(withdraw_amount[withdraw_amount.index('.')+1:])>0):
print('Enter amount without any decimal value')
continue
withdraw_amount=int(withdraw_amount)
if(withdraw_amount > checking_bal):
print('Insufficient balance in account')
start()
else:
print('Press C to confirm the withdraw of $',withdraw_amount,' from the savings account')
con = input()
if( con == 'c' or con == 'C'):
charge = (0.02*float(withdraw_amount))/100
savings_bal = savings_bal - withdraw_amount - charge
print('--'*10)
print('$',withdraw_amount,'withdrawn successfully with a charge of $',charge)
print('--'*10)
start()
else:
print('First be sure about what you do')
start()
  
elif( account == 'c' or account == 'C'):
while(True):
withdraw_amount = input('Enter amount to withdraw: $')
if('.' in withdraw_amount and int(withdraw_amount[withdraw_amount.index('.')+1:])>0):
print('Enter amount without any decimal value')
continue
withdraw_amount=int(withdraw_amount)
if(withdraw_amount > checking_bal):
print('Insufficient balance in account')
start()
else:
print('Press C to confirm the withdraw of $',withdraw_amount,' from the Checking account')
con = input()
if( con == 'c' or con == 'C'):
checking_bal = checking_bal - withdraw_amount
print('--'*10)
print('$',withdraw_amount,'withdrawn successfully')
print('--'*10)
start()
else:
print('First be sure about what you do')
start()
else:
print('Enter a correct option')
continue
elif(choice == 'e' or choice == 'E'):
print('--'*10)
print('HAVE A GOOD DAY')
print('--'*10)
exit()

else:
print('Please choose a correct option')
start()


checking_bal, savings_bal = 1000.0, 2000.0
print('--'*10)
print('WELCOME TO ATM')
print('--'*10)
access_code = int(input('Enter the Access Code: '))
if(access_code == 2222):
start()
else:
print('--'*10)
print('Wrong access code come later')
print('--'*10)


Related Solutions

Using a (GUI interface), write a Java program that simulates an ATM machine with the following...
Using a (GUI interface), write a Java program that simulates an ATM machine with the following options menu: "Welcome" 1. Deposit to account 2. Withdraw 3. Exit
Consider an automatic bank machine, known as Automatic Teller Machine (ATM), and a customer who wishes...
Consider an automatic bank machine, known as Automatic Teller Machine (ATM), and a customer who wishes to withdraw some cash from his or her banking account. Draw a UML system sequence diagram to represent this use case.
To gain access to his account, a customer using an automatic teller machine (ATM) must enter...
To gain access to his account, a customer using an automatic teller machine (ATM) must enter a 6-digit code ( 0 to 9). If repetition of the same digit is not allowed (for example, 555561 or 333333), how many possible combinations are there?(The first digit can not be zero) a)151200 b)136080 c)1,000,000 d)900,000
CASE Study: A Report on Global ATM Frauds The Automatic Teller Machine (ATM) was first commercially...
CASE Study: A Report on Global ATM Frauds The Automatic Teller Machine (ATM) was first commercially introduced in the 1960s. By 2005, there were over 1.5 million ATMs installed worldwide. The introduction of the ATM proved to be an important technological development that enabled financial institutions to provide services to their customers in a 24X7 environment. The ATM has enhanced the convenience of customers by enabling them to access their cash wherever required from the nearest ATM. However, as the...
IN PYTHON When you use an automated teller machine (ATM) with your bank card, you need...
IN PYTHON When you use an automated teller machine (ATM) with your bank card, you need to use a personal identification number (PIN) to access your account. If a user fails more than three times when entering the PIN, the machine will block the card. Assume that the user’s PIN is “1234” and write a program that asks the user for the PIN no more than three times, and does the following: •If the user enters the right number, print...
Write a python program that simulates a simple dice gambling game. The game is played as...
Write a python program that simulates a simple dice gambling game. The game is played as follows: Roll a six sided die. If you roll a 1, 2 or a 3, the game is over. If you roll a 4, 5, or 6, you win that many dollars ($4, $5, or $6), and then roll again. With each additional roll, you have the chance to win more money, or you might roll a game-ending 1, 2, or 3, at which...
Write a program that simulates a vending machine. The machine holds six snack items labeled them...
Write a program that simulates a vending machine. The machine holds six snack items labeled them 1 through 6. The program should initially display a menu of items along with their prices: Vending Machine 1. Roasted Almonds --> $1.25 2. Pretzels --> $1.75 3. Chewing Gum --> $0.90 4. Mints --> $0.75 5. Chocolate bar --> $1.50 6. Cookies --> $2.00 The program then should ask the user to enter the item to purchase along with a sum of money....
When you use an automated teller machine (ATM) with your bank card, you need to use...
When you use an automated teller machine (ATM) with your bank card, you need to use a personal identification number (PIN) to access your account. If a user fails more than three times when entering the PIN, the machine will block the card. Assume that the user's PIN is "1234" and write a program in python that asks the user for the PIN no more than three times, and does the following: 1. If the user enters the right number,...
PYTHON BEGINNER Problem Write a program which, given a number, simulates rolling a pair of six-sided...
PYTHON BEGINNER Problem Write a program which, given a number, simulates rolling a pair of six-sided dice that number of times. The program should keep track of how many times each possible sum comes up using a list. The list's first element should contain how many times a total of 2 was rolled, the second should contain how many times a total of 3 was rolled, and so on all the way through to 12. When all rolls are complete,...
Consider requirements and technology for an analysis of an Automated Teller Machine (ATM) design. Type an...
Consider requirements and technology for an analysis of an Automated Teller Machine (ATM) design. Type an outline out for an ATM system design using the below HCI criteria. Use eye-tracker data to further analyze the product Consider accessibility (universal usability) issues such as lighting, physical placement of ATM, etc. Consider user profile issues, e.g. is this the first time a user is using an ATM? Requirement to perform beta and/or market tests? Are there other stress factors such as a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT