about | help | code help+videos | done | prefs |
This method accepts a positive double parameter that represents an amount of money in dollars and cents. The method returns a string with the amount of dollars and cents written explicitly as "x dollars and y cents" where x is the total amount of dollars and y is the total amount of cents (between 0 and 99). Note that the cents are rounded to the nearest cent. moneyStr(0.0) → "0 dollars and 0 cents" moneyStr(0.0944) → "0 dollars and 9 cents" moneyStr(42.01) → "42 dollars and 1 cent" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 435
Copyright Nick Parlante 2017 - privacy