Answered step by step
Verified Expert Solution
Question
1 Approved Answer
class Customer: A simple class that represents a customer at the bank. def __init__(self, name,
class Customer: """ A simple class that represents a customer at the bank. """ def __init__(self, name, ssn): if type(name) is not str or len(name) < 2: raise AttributeError("Invalid name for the account.") if type(ssn) is not str or not ssn.isnumeric(): raise AttributeError("Invalid SSN for the account.") self.name = name self.ssn = ssn
Class diagram Customer o name: str ssn: str name: str o balance: property [float] accounts: list or dict create_account(customer: Customer, category: str): Account o find_accounts_by_name(name: str): Account[] o find_accounts_by_ssn(ssn: str): Account[] amount: float o owner: Customer withdraw(value: float): None o deposit(value: float): None Account CreditAccount Bank transfer(account: Account, value: float): None compute_interest(): None interest: float compute_interest(): None (C) SavingsAccount o amount: property [float]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started