Question: Python Checking Account Class. Write a class named CheckingAccount that contains the current balance of the account (an int) and the following methods: init -

Python Checking Account Class. Write a class named CheckingAccount that contains the current balance of the account (an int) and the following methods:
- init - takes a balance parameter to initialize the data (balance)of the object.
- withdraw - takes an input parameter amount and modifies the data by reducing the balance. If amount results in an overdraw, subtract an extra 20 dollars. This method should return the balance.
- deposit - takes an input parameter amount and modifies the data by increasing the balance by amount.
Write a few test cases to check your work.
Exercise 7 Write a class named "CheckingAccount that contains the currentbalanceof the account (an int) and the following methods: init - takes a "balance" parameter to initialize the data (balance)of the object. withdraw - takes an input parameter "amount" and modifies thedata by reducing the balance. If "amount" results in an overdraw, subtract an extra 20 dollars. This method should return the balancebalance. deposit - takes an input parameter "amount" and modifies the databy increasing the balance by "amount". Write a few test cases to check your work In [1]: ## Write your class here In [ ]: ## Test your class here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
