Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python programming language, implement the following classes represented in the diagrams with their relations: Person + name: string +tel: string +id: int +init(n:name, tel:string,

image text in transcribed

Using Python programming language, implement the following classes represented in the diagrams with their relations: Person + name: string +tel: string +id: int +init(n:name, tel:string, id:int) +display(): void +str():string Customer + accountNo: string + accountValue: float +init(n:name, tel:string, id:string, accountNo:string, accountValue:float) +display(): void +stro:string Bank +bank_name: string +address: Address +branch_no: int +Customers: list of Customers +init(n:name, add:string, bn:int) +displayO: void +str(:string Note that: Customer is a subclass of Person There is a composition relation between the class Bank and the class Customer The program should run with correctly and provides the output below based on the following main code: 1 In the main code: #main code pl = Person('ali', '076344343', '2000344545') pl.display print(pl) cl = Customer('ahmad', '076344322', '2002335566', '111111', 2000) c2 = Customer('sara', '075366322', '2004335577', '222222', 3500) c2 += 2500 # add/deposit 2500 to the accountValue for object c2 cl -= 500 # subtract/withdrow 500 from the accountValue of object cl cl.display c2.display bank1 = Bank('International JJ Bank', 'Irbid, Jordan', 200200, 1) bankl display bank1 = bank1 + c1 # add cl to the list of customers bankl = bankl + c2 # add c2 to the list of customers bank1.display

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions