diff --git a/1ano/2semestre/poo/src/aula03/Investment.java b/1ano/2semestre/poo/src/aula03/Investment.java index 3730a5a..92cb2cd 100644 --- a/1ano/2semestre/poo/src/aula03/Investment.java +++ b/1ano/2semestre/poo/src/aula03/Investment.java @@ -12,8 +12,8 @@ public class Investment { double investment; do { System.out.print("Introduza o investimento inicial (mĂșltiplo de 1000): "); - investment = sin.nextInt(); - } while (investment <= 0 || investment % 1000 != 0); + investment = UserInput.getPositiveNumber(sin); + } while (investment % 1000 != 0); System.out.print("Introduza a taxa a aplicar (entre 0% e 5%): "); double tax = UserInput.getNumberBetween(sin, 0, 5);