Question: Main.java public class Exercise 0 2 _ 2 1 { public static void main ( String [ ] args ) & java.util.Scanner input = new

Main.java
public class Exercise02_21{
public static void main(String[] args) &
java.util.Scanner input = new java.util.Scanner(
System.in):
// Enter the investment amount
System.out.print(
"Enter the investment amount, for example 120000.95: "):
double investmentAmount = input. nextDouble():
// Enter yearly interest rate
System.out.print("Enter annual interest rate, for example 8.25: ");
double annualinterestRate = input nextDouble () :
// Obtain monthly interest rate
double monthlyInterestRate = annualinterestRate ?1200 :
// Enter number of years
System.out.print(
"Enter number of years as an integer, for example 5: "):
int numbefears = input. nextInt ():
double futurevalue =
investmentAmount * Math.pow(1+ monthlyInterestRate,
num0fYears *12):
System.out.print("Future value is "+
(int)(futureValue *100)/100.0):
}
}
 Main.java public class Exercise02_21{ public static void main(String[] args) & java.util.Scanner

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!