- 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$
6 Réponses
+ 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)...
+ 1
Hassan Sars no I can’t, this is a forum to learn not to have your work done for you
+ 1
Hassan Sars in the politest way possible, your deadline is not my problem
- 1
Rincewind bro
Please can you write the complete code for me?
- 1
It a live project that requires an answer before 30 mins time
Help!!
I will come back to learn
- 1
Please