You are to create a simple bank account system based on the class below Account - accNumber: int - balance: double - first name:string - last name:string __init__...

1 answer below »




You are to create a simple bank account system based on the class below















Account




- accNumber: int


- balance: double


- first name:string


- last name:string




__init__ (accNumber,firstname,lastname,balance)


__str__()


deposit (amount:double):bool


withdraw(amount:double):bool


getAccountNumber():int


getBalance():double


getFirstName():string


getlastName():string













The above class represents a typical bank account object. You must first create a class that represents the above specification.


Create a user interface for the system as shown below.



Welcome to GBC Account System


Please select an option from the list below.


1. Add Account


2. Deposit


3. Withdraw


4. View Account


5. Exit




Add Account
should allow the user to Add a new Account to the system. It should ask for the following:


· Account number(an integer),


· The firstname on the account,


· The last name on the account


· The opening balance.


An account must then be created and
added to a list of accounts




Deposit
should ask the user for:


· An account number


· An amount to deposit


Once the amount to deposit is a positive number, should deposit it into the account.




Withdraw
should ask the user for:


· An account number


· An amount to withdraw


Note you should only withdraw if the balance on the account will be 0 or more after the transaction.




View Account
should ask the user for:


· An account number


It should display all the information about the account if it exists.




Exit
should clear the screen and give a departing message


·
Remember marks will be lost if

variable names are not appropriate









Answered Same DayJul 24, 2021

Answer To: You are to create a simple bank account system based on the class below Account - accNumber: int -...

Neha answered on Jul 30 2021
146 Votes
account = [
    {
        'accNumber':12345,
        'firstName':'Joy',
'lastName':'Smith',
'balance':300
    }
]
class Customer:
def __init__(self, firstName, lastName,accNumber, balance):
self.firstName = firstName
self.lastName = lastName
self.accNumber = accNumber
self.balance = balance
def addAccount():
accNumber = int(input("Enter the account number of the customer"))
firstName = input("Enter the first name of the customer")
lastName = input("Enter the last name of the customer")
balance = input("Enter the balance of the customer")
account.append({'accNumber':accNumber,'firstName':firstName,'lastName':lastName,'balance':balance})
print("Account successflly Created")
def deposit():
accNumber = int(input("Enter the account number of the customer"))
for sub in account:
if sub['accNumber'] == accNumber:
amount = input("Enter the...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here