import java.util.Scanner; public class MoneyDemo { public static void main (String[] args) { Scanner keyboard = new Scanner(System.in); Money aDemo = new Money(); String function; aDemo.readInput(); Money firstAmount = new Money(firstDollars, firstCents); Money secondAmount = new Money(secondDollars, secondCents); Money theResult = new Money(); System.out.println("If you would like to add your two sums together, " + "press the A key."); System.out.println("If you would like to subtract the second value " + "entered from the first, press the S key."); function = keyboard.next(); if (function.equalsIgnoreCase("a")) { aDemo.addMoney(firstAmount, secondAmount); } else if (function.equalsIgnoreCase("s")) { aDemo.subtractMoney(firstAmount, secondAmount); } else System.out.println("Invalid input."); } }