Source of MoneyDemo.java


  1: 
  2: public class MoneyDemo
  3: {
  4:     public static void main(String[] args)
  5:     {
  6:         Money start = new Money( );
  7:         Money goal = new Money( );
  8:         System.out.println("Enter your current savings:");
  9:         start.readInput( );
 10:                 
 11:         goal = start.times(2);
 12:         System.out.print("If you double that, you will have ");
 13:         goal.writeOutput( );
 14:                 
 15:         System.out.println(", or better yet:");
 16:         goal = start.add(goal);
 17:         System.out.println("If you triple that original amount, you will have:");
 18:         goal.writeOutput( );
 19:                 
 20:         System.out.println( );
 21:         System.out.println("Remember: A penny saved");
 22:         System.out.println("is a penny earned.");
 23:     }
 24: }