id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > moneyStr
prev  |  next  |  chance

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)

public String moneyStr(double cash) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 435

Copyright Nick Parlante 2017 - privacy