I have a challenge for some beginners! Make a cash register with a working change machine | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

I have a challenge for some beginners! Make a cash register with a working change machine

For example, If I bought a peice of gum that was 13 cents with a 20 dollar bill the output should say, Your change is: $19.87 Have fun writing. (I know I "did" a year or two ago)

19th Dec 2017, 2:20 AM
Evan Martine
9 Answers
+ 3
This problem seemed interesting to me so I gave it a try.Bonus it can show the nth prime number so if you want the 1000th one just input 1000. Edit: Thank you so much for choosing my answer as best answer!😄 https://code.sololearn.com/cPaPJmpAGgER/?ref=app
26th Apr 2018, 7:50 AM
Uni
Uni - avatar
+ 10
https://code.sololearn.com/c56CE68Hb10t/?ref=app
20th Dec 2017, 1:41 PM
Kulanga Kaushani
Kulanga Kaushani - avatar
+ 8
@Coming In Second I like more bonus round.😊
23rd Dec 2017, 1:11 AM
Kulanga Kaushani
Kulanga Kaushani - avatar
+ 6
Is the quantity of that item also considerable? https://code.sololearn.com/cO19a9ZXNnmk/?ref=app
20th Dec 2017, 2:55 PM
Kulanga Kaushani
Kulanga Kaushani - avatar
+ 5
22nd Dec 2017, 3:06 PM
Kulanga Kaushani
Kulanga Kaushani - avatar
+ 3
Its supposed to be a challenge, It teaches you brain storming and how to use math functions in Java
20th Dec 2017, 11:19 AM
Evan Martine
+ 3
@Kulanga Are you up for a bonus round? Now instead of printing a single number have your code print currency to the output. Example: $20 - $13.40 //Your change is: 6 Dollars 2 Quarters 1 Dime
20th Dec 2017, 5:46 PM
Evan Martine
+ 1
@Kulanga Kaushani Heres another bonus question, Write a program to print the 1000th prime number
23rd Dec 2017, 2:22 AM
Evan Martine
0
Is this really for beginners? I like it though.
20th Dec 2017, 11:08 AM
Jimmy2890
Jimmy2890 - avatar