In: Computer Science
Focuses on the design, development, implementation, and testing
of a Python program using Jupyter Notebook only to solve the
problem described below. You will write a program that simulates an
Automatic Teller Machine (ATM). For this program, your code can
have of user-defined functions only. However, the program must not
call on any external functions or modules to handle any of the
input, computational, and output requirements. Note, the program
can be completed without the use of user-defined functions.
Requirements:
There is one customer with the following profile:
• Name: John Smith
• This customer has two account types—Checking and Savings Accounts
with balances starting with $1000 each.
• When the program starts, customer name and accounts starting
amounts must be processed and stored before the customer
interacting with the system.
Customer Choices (Sub-menu choices based on the type of
transactions)
1) View Balance
2) Deposit
3) Transfer
4) Withdraw
5) Exit
Account Processing Restrictions
a) The balances of each account type must be updated base on
selected customer choices.
b) The customer can only withdraw from the Checking Account but can
only withdraw if there is enough money in the account 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.
c) When the request to View Balance, the appropriate output must
display the balance for each account type and the accounts' total
balance.
d) A customer can only transfer money from the checking to the
savings account. However, there is a transfer fee charge. (.05% of
the total amount transfer). The fee must be displayed as part of
the output when the customer performs this operation. Moreover, the
customer can only transfer if there is enough money for the
transfer and its respective transfer fee charge. The customer must
be presented with an appropriate message showing the transferring
account balance before completing such a transaction.
e) The system will not accept a deposit > $600
f) The customer cannot deposit, withdraw, or transfer partial
currency (ex: $200 is valid. $200.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 by your instructor 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
Program Code (Not using any User-defind function)
print("Wellcome to Autometic Teller Machine ")
name= input("Enter Name :")
checkaccount =int( 1000)
savingsaccount=int( 1000)
print("NAME : ",name)
print("Savings Account Balance is :$ ",savingsaccount)
print("Checking Account Balance is :$ ",checkaccount)
while True :
print("Choice Manu :")
choice=int(input("1)View balance 2)Deposit Balance 3)Transfar 4) Withdraw 5) Exit :"))
if(choice==1):
print("Savings Account Balance is :$ ",savingsaccount)
print("Checking Account Balance is :$ ",checkaccount)
print("Total Balance is : ",savingsaccount + checkaccount)
elif (choice==2):
deposit=int(input("Enter Amount for Deposit :$"))
if(deposit>600):
print("System didnot accept the deposit,Deposit must be lessthan $600")
else:
savingsaccount= savingsaccount+ deposit
print("Amount Deposited Successfully !!")
elif (choice==3):
Transfar=int(input("Enter the Amount is transfer :$ "))
if(Transfar>savingsaccount):
print("Insufficient Balance for transfer")
else:
servicecharge= Transfar * (.05/100)
transferamount = Transfar + servicecharge
savingsaccount=savingsaccount - transferamount
checkaccount= checkaccount + transferamount - servicecharge
print("Service charge is ",servicecharge)
print("Amount is Transferd !!")
elif (choice==4):
withdraw=int(input("Enter ammount to withdraw : "))
print("Withdrawing Amount is :",withdraw)
if(withdraw>savingsaccount):
print("Enterd Amount would not sufficient for withdraw")
else :
savingsaccount=savingsaccount - withdraw
print("Withdraw amount Successfully !!")
elif (choice==5):
print("System Exit")
break
else:
print("Wrong choice enter please enter the correct choice !!")
Output Case Run
Wellcome to Autometic Teller Machine
Enter Name :John Smith
NAME : John Smith
Savings Account Balance is :$ 1000
Checking Account Balance is :$ 1000
Choice Manu :
1)View balance 2)Deposit Balance 3)Transfar 4) Withdraw 5) Exit
:2
Enter Amount for Deposit :$800
System didnot accept the deposit,Deposit must be lessthan $600
Choice Manu :
1)View balance 2)Deposit Balance 3)Transfar 4) Withdraw 5) Exit
:2
Enter Amount for Deposit :$500
Amount Deposited Successfully !!
Choice Manu :
1)View balance 2)Deposit Balance 3)Transfar 4) Withdraw 5) Exit
:3
Enter the Amount is transfer :$ 700
Service charge is 0.35000000000000003
Amount is Transferd !!
Choice Manu :
1)View balance 2)Deposit Balance 3)Transfar 4) Withdraw 5) Exit
:1
Savings Account Balance is :$ 799.65
Checking Account Balance is :$ 1700.0
Total Balance is : 2499.65
Choice Manu :
1)View balance 2)Deposit Balance 3)Transfar 4) Withdraw 5) Exit
:4
Enter ammount to withdraw : 900
Withdrawing Amount is : 900
Enterd Amount would not sufficient for withdraw
Choice Manu :
1)View balance 2)Deposit Balance 3)Transfar 4) Withdraw 5) Exit
:4
Enter ammount to withdraw : 600
Withdrawing Amount is : 600
Withdraw amount Successfully !!
Choice Manu :
1)View balance 2)Deposit Balance 3)Transfar 4) Withdraw 5) Exit
:1
Savings Account Balance is :$ 199.64999999999998
Checking Account Balance is :$ 1700.0
Total Balance is : 1899.65
Choice Manu :
1)View balance 2)Deposit Balance 3)Transfar 4) Withdraw 5) Exit
:5
System Exit