Question: Step 2 : Write a class Once you have identified the object that is instantiated in the code sample, write the corresponding class for that
Step : Write a class
Once you have identified the object that is instantiated in the code sample, write the corresponding class for that object. Think about the things this class would need to have for each line of the code sample to run. Include all necessary attributes and methods to support the functionality demonstrated in the
main method. Within ygur class, ensure that users can't purchase an item larger than the amount in their account, and that only positive values are added to a gift card. You do not need to include exception handling in your answer, unless you want to
Sample OutputInitial Accounts:Name: Tom Jerry, Balance: $Name: Sally Field, Balance: $Purchase successful for Insufficient funds for purchase of $ Gift card of $ added successfully
Accounts After Transactions:
Name: Tom Jerry, Balance: $
Name: Sally Field, Balance: $
Purchase successful for
Gift card of $ added successfully
Transfer $ from Tom to Sally
Final Accounts:
Name: Tom Jerry, Balance: $
Name: Sally Field, Balance: $
Process finished with exit code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
