Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Finally, we have the creditAccount. With credit cards you have a certain balance to start that is given to you on credit ( kind of
Finally, we have the creditAccount. With credit cards you have a certain balance to start that is given to you on credit kind of like a loan Well say $ will be the default and this value can be recorded as the creditLimit an int is fine to store this though the value with this account will record not how much money you have in the account but how much you have charged to it When you withdraw money you are adding to the value and if we getValue we want to know how much credit we have left before we reach our limit so we will have to overwrite that method as well in this class Note that we cannot overdraft our account so we will have to make sure any withdraws do not let the value exceed the credit limit though deposits, which subtract from the value, may exceed the and thus there would be a negative value in the account showing that you have more than the credit limit that you can use
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started