java final

14
Financial application: package q1.pkgfinal; import java.util.*; public class Q1Final { public static void main(String[] args) { double amount; double interest; int months; double Total =0; Scanner input = new Scanner(System.in); System.out.println("Please enter the amount"); amount = input.nextDouble(); System.out.println("Please enter the interest"); interest = input.nextDouble(); System.out.println("Please enter the number of months"); months = input.nextInt(); double intPerMonth = (interest/12); for (int i=1; i <= months; i++) { Total = ((Total + amount) * (1+intPerMonth)); }

Upload: jefferry-huynh

Post on 08-Sep-2015

221 views

Category:

Documents


0 download

DESCRIPTION

Java final for ISAM class

TRANSCRIPT

Financial application:package q1.pkgfinal;import java.util.*;public class Q1Final { public static void main(String[] args) { double amount; double interest; int months; double Total =0; Scanner input = new Scanner(System.in); System.out.println("Please enter the amount"); amount = input.nextDouble(); System.out.println("Please enter the interest"); interest = input.nextDouble(); System.out.println("Please enter the number of months"); months = input.nextInt(); double intPerMonth = (interest/12); for (int i=1; i = 0; j --) { System.out.println(num[j]); } }