This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def pluralize(base_word) | |
| return base_word[-1] == "s" ? base_word : `#{base_word}s` | |
| end | |
| # Irregular noun | |
| pluralize("mice") | |
| // "mices" | |
| # Proper Noun | |
| pluralize("Bill Gates") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // TODO | |
| // | |
| //Exercise 1 - Need to round to 2 digits | |
| function billTotal(subtotal) { | |
| const TAX = 0.095; | |
| var tip = 0.15; | |
| return Math.round(subtotal + (subtotal * TAX) + (subtotal * tip)); |