Professional Documents
Culture Documents
Kanda Libera Python Requirement
Kanda Libera Python Requirement
Create a program that reads a number that corresponds to a specific action, chosen by the user
from the choices:
1 for Deposit;
2 for Withdraw;
3 for Exit.
The first part of the program must show the account details of the user, a welcoming message and
the options that can be used (as shown). This block shall be looped every time a process or option is
picked, but the values will be updated depending on the action that is taken:
Account Details:
Name: Sandialen A. Kanda
ID: 1319695
Balance: P250000
The option 1 should deposit an amount and will be added to the balance, option 2 should
withdraw an amount from the balance, and option 3 should exit the program. Any amount that will
exceed the amount to be withdrawn should show a message “Withdraw amount greater than current
balance!" and when it is negative "ERROR: Withdraw amount less than zero!"
“Pick a process:” should be used as the prompt that will ask the user to input the number. This
part shall be looped as well. A number that is entered by the user which is not within the 3 options
should show a message “ERROR: Process not found!”
SOURCE CODE:
(1) File name: atmApp.py
class atmApp:
#contrucstor to initialize values
def __init__(self, owner, idNum, balance) -> None:
self.runApp = 1
_name = owner
_idNum = idNum
bal = balance
print("--------------------------")
print("Account Details:")
print("Name: " + name)
print("ID: " + idNum)
print("Balance: P" + str(bal))
print("--------------------------")
print("Welcome to Bob's ATM! How may I help you today?")
print()
print(prcss := input("Pick a process: "))
self.processBranching(prcss, name, idNum, bal)
# main = atmApp(
# "Sandialen Kanda III",
# "731491",
# 250000
# )
# main.__init__
Prints optionsList:
"(1) Deposit",
"(2) Withdraw",
"(3) Exit"
User deposits
“1”
True an amount: dpstAmt is added to bal
dpstAmt
False
End
False False
wtdrwAmt is
subtracted to bal