Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Investment {
- public static void main(String[] args) {
- //declare variables
- double money;
- double interest;
- int years;
- Scanner input;
- //initialise variables
- money = 0;
- interest = 0;
- years = 0;
- input = new Scanner(System.in);
- System.out.println("How much are you investing?");
- money = input.nextDouble();
- System.out.println("How much is the interest rate?");
- interest = input.nextDouble();
- System.out.println("How many years will this mature?");
- years = input.nextInt();
- }
- public static double futureInvestmentValue(
- double investmentAmount, double monthlyInterestRate, int years) {
- for(int i=0; i<years; i++) {
- futureInvestmentValue =
- investmentAmount x (1 + monthlyInterestRate)numberOfYears*12
- }
- }
Add Comment
Please, Sign In to add comment