@@ -0,0 +1,2107 @@
+/** A program to gauge the expected cost of an item in a specified number of%0A *  years. The program asks for the cost of the item, the number of years from%0A *  now that the item will be purchased and the rate of inflation. It then %0A *  outputs the estimated cost of the item after the specified period.%0A */%0A%0Apackage inflationcalculator;%0A%0A/**%0A *%0A * @author k8port%0A */%0Aimport java.util.Scanner;%0Aimport java.text.DecimalFormat;%0Aimport java.text.NumberFormat;%0Aimport java.util.Locale;%0A%0Apublic class InflationCalculator %7B%0A%0A    /**%0A     * @param args the command line arguments%0A     */%0A    public static void main(String%5B%5D args) %7B%0A        %0A        // instance variables%0A        Scanner scan = new Scanner(System.in);%0A        DecimalFormat form = new DecimalFormat(%22#0.0#%25%22);%0A        NumberFormat moneyFormat = NumberFormat.getCurrencyInstance();%0A        String item;        // the item%0A        int years;          // the number of years%0A        double inflation;   // the rate of inflation%0A        double cost;        // the cost of the item%0A        %0A        // gather input%0A        System.out.println(%22Inflation Calculator.%22);%0A        System.out.println(%22Enter the item you are purchasing.%22);%0A        item = scan.nextLine();%0A        System.out.println(%22Enter how much it costs.%22);%0A        cost = scan.nextDouble();%0A        System.out.println(%22Enter how many years from now you will be purchasing%22%0A                + %22  the item.%22);%0A        years = scan.nextInt();%0A        System.out.println(%22Enter the current rate of inflation.%22);%0A        inflation = scan.nextDouble();%0A        %0A        inflation /= 100; // convert percentage to a fraction%0A        %0A        for (int i = 0; i %3C years; i++) %7B%0A            cost += cost * inflation;            %0A        %7D%0A        %0A        String percent = form.format(inflation);%0A        String money = moneyFormat.format(cost);%0A        //System.out.println(%22cost: %22 + money);%0A        //System.out.println(%22Inflation: %22 + percent);%0A        System.out.printf(%22In %25d years with an inflation rate of %25s the cost %22%0A               + %22will be %25s.%25n%22, years, percent, money);%0A    %7D%0A    %0A%7D%0A

Create InflationCalculator.java