Interest Rate

Interest Rate - Scanner in = new Scanner(System.in); double...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * Finding your interest rate based on years you keep money saved. */ package interestrate; import java.util.Scanner; /** * * @author Manny */ public class InterestRate { /** * @param args the command line arguments */ public static void main(String[] args) { System.out.println("Please enter the number of years : ");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Scanner in = new Scanner(System.in); double years = in.nextDouble(); double annualInterestRate = 0; if (years > 7){ annualInterestRate = 7.5;} else { annualInterestRate = 5.4; } System.out.println("Your interest Rate is: " + annualInterestRate + " percent."); } } Reply...
View Full Document

This note was uploaded on 12/07/2011 for the course BUS 350 taught by Professor Leighjin during the Fall '11 term at S.F. State.

Ask a homework question - tutors are online