/* 9/18/2017 */ import java.util.Scanner; /** * This class calculates percentages. */ public class Prize { /** main method gives the variable percentage three different * values, and then calculates the amount that will be left from the prize * were you to save the given percentage. */ public static void main(String[] args) { double prize=127000; double amtLeft; double percentage=.05; amtLeft=prize-prize*percentage; System.out.println("If you put away " + percentage*100 + "% you will have $" + amtLeft + " left over."); percentage=.08; amtLeft=prize-prize*percentage; System.out.println("If you put away " + percentage*100 + "% you will have $" + amtLeft + " left over."); percentage=.17; amtLeft=prize-prize*percentage; System.out.println("If you put away " + percentage*100 + "% you will have $" + amtLeft + " left over."); } }