calculate how long it would take to pay off a loan of 500 pounds if there was 10% interest monthly, and 100 pounds was paid each month. This code is in a pseudocode, but I can't figure out how to write it in Java, I'm really new to Java and need some assistance, I appreciate any help that is give, thanks!

Code:
set months = 1
set balance = 500
set totalpaid = 0;
while balance > 100
  balance = balance - 100;
  set interest = balance * 0.1
  balance = balance + interest
  totalpaid = totalpaid + 100
  months = months + 1
endwhile
totalpaid = totalpaid+balance
display "You paid "+totalpaid
display "It took you "+months+" months"