r/codehs • • Oct 04 '23

9.4.7 Inheritance codeHS nitro

I’ve been working on this and have tried different things but cannot figure out what to put in the highlighted sections. Could someone help me please?

2 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/5oco Oct 06 '23

So it looks like you're doing the math part right, but the super class is what's handling the deposits and withdrawals. That's where the balance is being updated.

So call the super method from the child class, and pass in the result of your math as the argument.

Sort of like you're doing with the constructor.