← Back to Classes
Question 480
Deposit Into The Account
Deposit Into The Account
A BankAccount stores an owner and a balance. Write the body of deposit so it adds amount to the balance; the method changes the object and returns nothing. Do NOT write a main block or any top-level test code; the tests construct the class. Input: one line, the amount to deposit, which the tests read as a float, pass to deposit on an account opened with 100.0, and then print the balance.
Expected Output:
150.0= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
Classes
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.