countCoins JavaScript

Download Category:

countCoins.zip - (18.7 KB)
[
countCoins/code.js
countCoins/index.html
countCoins/Question.txt
countCoins/Screenshot_1.jpg
countCoins/Screenshot_2.jpg
]

Write a JavaScript program to make change. You should use prompt() to read a string and parseInt() to convert the string into an integer number of cents (i.e. fractions of a dollar). Your program should write to the document how to deliver that number of cents as change using a minimum number of US coins as output. Ignore the 50 cent piece as a possible coin. So for example, given an input of 87, your program should output the following to the document:
87 cents is comprised of:
3 quarter(s)
1 dime(s)
0 nickle(s)
2 pennies
Hint: Remainders from division are calculated with the modulus operator.

Write a Review

Get a fresh solution of this question. Ask it now to our experts.
doubt

Ask Your Question

We have verified professionals who are ready to answer your question.

time

Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.

download

Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.