Question: You are to write a Python program that simulates a very simple ATM machine. An account owner ( user ) should be able to enter
You are to write a Python program that simulates a very simple ATM machine. An account owner user should be able to enter a pin number and select from a menu of transactions: Deposit, Withdraw, Balance and Quit. You are to assume that the user has only one account on which these transactions can be performed. This account is associated with the users pin number. The ATM should properly and regularly communicate with the user. The ATM should get information on current accounts from a file accountscsv This file is posted with the assignment. Each line of the file contains a digit code pin first name, last name, and the account balance. Partial contents of accounts.csv file follows:
Inside a loop, prompt the user for an amount to be deposited or withdrawn; at this point it does not matter which it is The amount must be converted to float. If the amount is negative, print Negative amount. Try again'.
Code an exception Invalid amount. Use digits only. An interruption would be caused if the user enters a string instead of a numeric value, or hits the enter key without entering anything.
Stay in the loop until a valid number is entered and return amount.
pts Write a function depositpin d that takes as input the user's pin number and the dictionary. The function calls verifyAmount calculates the new balance and updates the dictionary. The function does not return a value, but it should have a return statement.
pts Write a function withdrawpin d that takes as input the user's pin number and the dictionary. The function calls verifyAmount If the amount to be withdrawn is greater than the balance print Insufficient funds to complete the transaction' The user should be prompted to enter a new amount, until the amount entered is less than the balance or The function uses the balance in the dictionary to calculate the new balance. The balance is updated in the dictionary. This function does not return a value, but it should have a return statement.
pts Write a function balance pin d that takes as input the user's pin number and dictionary and returns the user's balance from the dictionary.
pts Write a function quitpin d that takes as input the user's pin number and dictionary. The user is prompted as to whether or not she wishes to leave the transaction. If she does y then call receiptpin d to print a receipt for the session; see sample below If she does not want to leave n the application, then return the user's response.
pts Write a function receiptpin d that takes as input the user's pin number and dictionary. The function does not return a value but it should have a return statement. The receipt should contain the name of the bank branch and address, the current date, the account user's full name, the available balance formatted as currency and the message 'thanks for using the ABC Banking system'. Use the sample below for the layout and verbiage.
ABC Bank Branch Receipt
Bank St
Anytown, USA
Date:
Name: Daffy Duck
Available Balance: $
Thank you for using the ABC Banking System
'Goodbye'
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
