CJCoding With Joseph
15free / daySign inCreate 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
Topics:
Classes
📥 Auto-Input:
50\n
This input is automatically fed to your program's stdin
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.