Open choongzhanhong opened 1 year ago
Yep, aside from the spacing and println
vs print
, the other important thing is to format the final line properly. Just using .toString
would yield 0.0
if the sum is 0, however coursemology requires the output to be 0.00
.
Errm.. thanks for pointing it out. Let me get some of these fixed.
print
vs println
was a conscious choice due to some Coursemology limitations.
Hi folks, this was originally supposed to be a help request for Ex10, but I found the solution while writing this, so I'm sharing with the rest of you.
Note that the desired output is this:
Your expenses while overseas?Expenses in overseas currency:[$4.50, $3.00, $5.00] Total in local currency: $21.25
The skeleton code does not use
println
but instead usesprint
(Does not automatically go to a newline). Also note there is no space between"Expenses in overseas currency:"
and your array. These have to match the output on Coursemology to be considered correct.Honestly, the desired output is not very nice because of inconsistent spacing, but oh well. Coursemology asks, I give.