import java.io.PrintStream; import java.util.Scanner; import labtest1.GoldPrice; /** * An app about gold prices. * * @author Franck van Breugel */ public class Test1A { public static void main(String[] args) { Scanner input = new Scanner(System.in); PrintStream output = System.out; // Phase 1 output.print("The amount of gold in grams: "); // Phase 2 double amount = input.nextInt() / GoldPrice.GRAMS_PER_TROY_OUNCE; // Phase 3 double now = amount * GoldPrice.get(0); output.printf("The current value is $ %.2f%n", now); // Phase 4 output.print("The number of weeks ago? "); // instead of weeks I should have puts days // Phase 5 int weeks = input.nextInt(); // Phase 6 double then = amount * GoldPrice.get(weeks); double difference = now - then; output.printf("The difference is $ %.2f%n", difference); } }