Question: you'll be using object oriented programming to create a user _ account class. You'll then use this class to create objects for some user accounts.

you'll be using object oriented programming to create a user_account class. You'll then use this class to create objects for some user accounts. This program will also need to have good unit testing coverage
Details:
Create a class called user_account
Your class should have three methods:
deposit
Accepts an amount and adds this amount to the account_balance
withdrawal
Accepts an amount and deducts this amount from the account_balance
If the withdrawal amount would cause the account to go negative, print that this transaction can't be completed and don't deduct from account_balance
display
This method should output all information about the user_account object
Now that your class is created, create two objects
account1 should be a checking account (any account_owner, account_num is fine)
add a balance of $400 to this account
withdraw $250 from this account
display the information about this account
account2 should be a savings account (any account_owner, account_num is fine)
add a balance of $50 to this account
attempt to withdraw $100
display the information about this account
Ensure that your unit tests cover these scenarios (SetUp and TearDown should be used)

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!