computer science homework

profileJoshuaTT

 Design and write a Java procedure named printMoney that prints a floating-point number as a currency value (with a $ sign and exactly two decimal digits):

 

/*

    printMoney ( double )

 

    procedure outputs an amount in currenct format

 

    ex1: printMoney( 1234.5678 ) outputs "$1,234.56"

    ex2: printMoney( 0 ) outputs "$0.00"

    ex3: printMoney( -1234.5678 ) outputs "-$1,234.56"

 

*/

    • 11 years ago
    • 3
    Answer(2)

    Purchase the answer to view it

    blurred-text
    NOT RATED

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      currency.rtf
    Bids(0)