Refactored to utils method

This commit is contained in:
TiagoRG 2023-02-26 16:49:59 +00:00
parent 2417cc1152
commit c94006cba8
1 changed files with 2 additions and 2 deletions

View File

@ -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);