You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exercises/practice/bank-account/.docs/instructions.append.md
-31Lines changed: 0 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,36 +1,5 @@
1
1
# Instructions append
2
2
3
-
## Implementation Notes
4
-
5
-
### Opening an account
6
-
7
-
An account can be opened.
8
-
On opening, its initial balance should not be negative.
9
-
If a negative balance is given to the `Open` function, `nil` must be returned, otherwise the newly created account must be returned.
10
-
11
-
### Closing an account
12
-
13
-
An account can be closed.
14
-
When closing an account, the `Close` method must return the balance the account has and a boolean `true` indicating the account was closed successfully.
15
-
Closing an account does not succeed if the account is already closed.
16
-
When an account is closed, its balance must be set to `0`.
17
-
18
-
### Getting the account balance
19
-
20
-
The `Balance` method allows a user to check the current balance of an account.
21
-
It must return the balance of the account and a boolean indicating if the operation succeeded.
22
-
Checking the balance only doesn't succeed if the account is closed.
23
-
24
-
### Deposits / Withrawals
25
-
26
-
Deposits and withdrawals are both handled by the `Deposit` method.
27
-
If the argument given to the method is a positive amount, then that amount of money must be deposited in the account.
28
-
If the amount given is negative, that amount of money must be withdrawn from the account.
29
-
If the account is closed, its balance must not be modified.
30
-
31
-
`Deposit` returns the new balance of the account and a boolean that indicates if the operation succeeded.
32
-
`Deposit` must fail if the account is closed or if there is not enough money to withdraw from the account.
33
-
34
3
## Testing
35
4
36
5
The tests will execute some operations concurrently.
0 commit comments