:::::::::::::: Mean.java :::::::::::::: class Mean { public static void main(String[] args) { ConsoleReader c = new ConsoleReader(System.in); System.out.print("Enter value: "); String line = c.readLine(); double sum = 0; int i = 0; while (! line.equals("done")) { double score = Double.parseDouble(line); sum = sum + score; i = i + 1; System.out.println("Score " + i + " entered: " + score + ", current sum: " + sum); System.out.print("Enter value: "); line = c.readLine(); } if (i > 0) { System.out.println("The average of entered scores is: " + sum / i); } else { System.out.println("No scores, no average. Thank you."); } } } :::::::::::::: PostOffice.java :::::::::::::: class PostOffice { public static void main(String[] args) { ConsoleReader c = new ConsoleReader(System.in); System.out.print("Weight (lbs): "); double w = c.readDouble(); if (w <= 2) { System.out.println("Less than 2 lbs. Mailing cost is 10 dollars."); } else { if (w > 100) { System.out.println("Sorry, we can't mail packages over 100 lbs in weight."); } else { double cost; cost = 10; System.out.println(" 10 dollars for the first two pounds."); cost = cost + (w - 2) * 3.75; System.out.println(" " + (w - 2) * 3.75 + " dollars added for the weight that exceeds the 2 pounds. "); if (w > 70) { cost = cost + 10; System.out.println(" Over 70 pounds. Excess weight surcharge applies: 10 dollars."); } else { } System.out.println("Total mailing cost is " + cost + " dollars."); } } } }