import java.io.PrintStream; import java.util.Scanner; import labtest1.Interest; /** * An app about interests. * * @author Franck van Breugel */ public class Test1B { public static void main(String[] args) { Scanner input = new Scanner(System.in); PrintStream output = System.out; // Phase 1 output.println("The amount to be invested:"); // Phase 2 int amount = input.nextInt(); // Phase 3 double interest = amount * Interest.rate(amount); output.printf("The amount of interest: %.2f%n", interest); // Phase 4 double baseInterest= amount * Interest.BASE_RATE; output.printf("The amount of interest (based on the base rate): %.2f%n", baseInterest); // Phase 5 final double EPSILON = 0.01; boolean same = Math.abs(interest - baseInterest) < EPSILON; output.printf("Are the amounts the same? %b%n", same); } }