/* 9/18/2017 */ import java.util.Scanner; public class Prize2 { /* see Prize.java for description of class and methods. * this document reads in the three values instead of * assigning them. */ public static void main(String[] args) { double prize=127000; double amtLeft; Scanner in = new Scanner(System.in); double percentage=.1; System.out.print("Enter a percentage to save: "); percentage=in.nextDouble(); amtLeft=prize-prize*percentage; System.out.println("If you put away " + percentage*100 + "% you will have $" + amtLeft + " left over."); percentage=in.nextDouble(); amtLeft=prize-prize*percentage; System.out.println("If you put away " + percentage*100 + "% you will have $" + amtLeft + " left over."); percentage=in.nextDouble(); amtLeft=prize-prize*percentage; System.out.println("If you put away " + percentage*100 + "% you will have $" + amtLeft + " left over."); in.nextLine(); // to remove '\n' from input buffer System.out.println("What is your final message? "); String msg; msg=in.nextLine(); System.out.println("your message is: " + msg); char ch=52; System.out.println("my char is " + ch); } }