Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dollar class with the capability of being multiplied by scalars #1

Merged
merged 4 commits into from
Sep 28, 2022

Conversation

kaiosilveira
Copy link
Owner

@kaiosilveira kaiosilveira commented Sep 28, 2022

Our goal is to be able to sum $5 + 10CHF and get $10 back. To accomplish that, though, we will be taking small steps, all guided by tests. The initial structure added toward this goal, Dollar, is a class already able to hold an amount and to be multiplied by a scalar number (e.g. 2).

Our initial task list is:

  • $5 + 10CHF = $10 if rate is 2:1 🎯
  • $5 * 2 = $10 ✅
  • Make "amount" private
  • Dollar side-effects?
  • Money rounding?

Tasklist:
- $5 + 10CHF = $10 if rate is 2:1 🎯
Tasklist:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 * 2 = $10
@kaiosilveira kaiosilveira force-pushed the chapter1/initial-code-for-multi-currency-money branch from 348cea3 to c9c514a Compare September 28, 2022 18:51
Tasklist:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 * 2 = $10 👈🏼
- Make "amount" private
- Dollar side-effects?
- Money rounding?
Tasklist:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 * 2 = $10 ✅
- Make "amount" private
- Dollar side-effects?
- Money rounding?
@kaiosilveira kaiosilveira force-pushed the chapter1/initial-code-for-multi-currency-money branch from c9c514a to 03bce04 Compare September 28, 2022 18:54
@kaiosilveira kaiosilveira merged commit b152e54 into main Sep 28, 2022
@kaiosilveira kaiosilveira deleted the chapter1/initial-code-for-multi-currency-money branch September 30, 2022 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant