- 1

I would like to write a JavaScript that displays denomination of the amount deposited in the bank in terms of currency E.g

1000$ 500$ 40$ 5$ for example if i deposited 15,545$, the output should be like 15-1000$ 1-500$ 1-40$ 1-5$

17th Jul 2019, 10:59 AM
Hassan Sars
Hassan Sars - avatar
6 Respuestas
+ 1
You probably could do some while or if loops and use modulo(%)? For example, some rough pseudocode: deposit = 15545 while deposit >0: if deposit % 1000 != 0: countThousand = deposit - (deposit%1000) print("$1000 - " + countThousand) deposit = deposit - countThousand if deposit % 100 != 0: countHundred = deposit - (deposit%100)...
17th Jul 2019, 11:08 AM
Rincewind
Rincewind - avatar
+ 1
Hassan Sars no I can’t, this is a forum to learn not to have your work done for you
17th Jul 2019, 11:12 AM
Rincewind
Rincewind - avatar
+ 1
Hassan Sars in the politest way possible, your deadline is not my problem
17th Jul 2019, 11:15 AM
Rincewind
Rincewind - avatar
- 1
Rincewind bro Please can you write the complete code for me?
17th Jul 2019, 11:10 AM
Hassan Sars
Hassan Sars - avatar
- 1
It a live project that requires an answer before 30 mins time Help!! I will come back to learn
17th Jul 2019, 11:13 AM
Hassan Sars
Hassan Sars - avatar
- 1
Please
17th Jul 2019, 11:15 AM
Hassan Sars
Hassan Sars - avatar