Skip to content

Tag: while-loop

How can I shorten many while loops?

This is one of my first attempts to use Java and I tried my best, but I need to shorten it so it’s not so long. Important is that it keeps all the coins of the Euro. It’s a German code so geld means money. This part of the code System.out.println(rgeldt + ” mal 2 Euro”); just means how often

While loop calculation issue

I’m currently working on a Java program (for school) that prints two statements when a user enters a starting balance for their account. So for example, if the user inputs $10,000, there will be two statements that print at the same time. One tells them how long it will take for their account to reach $100,000, and the other when