/* IntCalc.java David G. Klick September 7, 2007 CIS 111 In-class demonstration program which uses input, processing, and output. */ public class IntCalc extends CIS111App { public static void main(String[] args) { // declare variables double prin; double interest; int years; int periods; double amt; // get principal, interest, years, periods prin = getDouble("Enter the principal: "); interest = getDouble("Enter the yearly interest: "); years = getInt("Enter the number of years: "); periods = getInt("Enter the number of periods per year: "); // calculate future value interest = interest / 100; double x = (1 + interest / periods); double y = (years * periods); amt = prin * Math.pow(x, y); // display future value println("The future value is " + amt); } }