Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

No wrong answer plz 1. Create a class BankAccount, the __init__(self, pin) method should initialize the balance as 0 and pin as pin. 2. Create

No wrong answer plzimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago