import cs1.Keyboard; /** Calculate total value of a number of Ugandan coins. @author Greg Vogl last modified 2003-09-22 */ public class Coins { /** Calculate total value of a number of Ugandan coins. */ public static void main (String[] args) { // get input System.out.println("Calculate total value of a number of Ugandan coins."); System.out.println("Enter the number of 500 shilling coins and press Enter."); int shs500 = Keyboard.readInt(); System.out.println("Enter the number of 200 shilling coins and press Enter."); int shs200 = Keyboard.readInt(); System.out.println("Enter the number of 100 shilling coins and press Enter."); int shs100 = Keyboard.readInt(); System.out.println("Enter the number of 50 shilling coins and press Enter."); int shs50 = Keyboard.readInt(); // calculate value int value = shs500 * 500 + shs200 * 200 + shs100 * 100 + shs50 * 50; // output results System.out.println("The value is " + value + "."); } }