Question: Write in Python the following: Create also a UML class diagram for this question. For this diagram, you can use any tool of your choice.

Write in Python the following:

 Write in Python the following: Create also a UML class diagram

Create also a UML class diagram for this question. For this diagram, you can use any tool of your choice.

Question 1: BankAccount.py 35 Marks 1. Create a class BankAccount, the _init__(self, pin) method should initialize the balance as 0 and pin as pin. 2. Create method name deposit (self, pin, amount), which takes 2 arguments, pin and amount. Method should increment account balance by amount and return new balance. If user wants to deposit more than 3000$ it should ask for the pin again and deposit if its correct. 3. Create method name withdraw (self, pin, amount), which takes 2 arguments, pin and amount. Method should decrement the account balance by amount and return new balance. When user try to withdraw the amount more than the amount in the account then It should display the message "Not sufficient balance". 4. Create method get_balance(self, pin), this method should return account balance. 5. Create method change_pin(self, old_pin, new_pin), should change the account pin. 6. If user try to enter the amount with the wrong pin program should display the "Wrong Pin error message. 7. Create two instances of the BankAccount and call all the methods

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!