Future investment

Q1. (Print a table) Write a program that displays the following table. Cast floating point numbers
into integers.

a b pow(a, b)
1 2 1
2 3 8
3 4 81
4 5 1024
5 6 15625
Q2. Write a program that reads in investment amount, annual interest rate, and number of years,
and displays the future investment value using the following formula:
and displays the future investment value using the following formula:
futureInvestmentValue =
investmentAmount * (1 + monthlyInterestRate)numberOfYears*12
For example, if you enter amount 1000, annual interest rate 3.25%, and number of years 1, the
future investment value is 1032.98.
Hint: Use the Math.pow(a, b) method to compute a raised to the power of b.
Here is a sample run:
Sample 1:
Enter investment amount: 1000
Enter annual interest rate: 4.25
Enter number of years: 1
Accumulated value is 1043.34
Sample 2:
Enter investment amount: 1000
Enter annual interest rate: 4.25
2
Enter number of years: 1
Accumulated value is 1043.34
Q3. Write a program that reads an integer between 0 and 1000 and multiplies all the digits in the
integer. For example, if an integer is 932, the multiplication of all digits is 54.
(Use % operator to extract digits, and use the / operator to remove the extracted digit. For
instance, 932%10 = 2 and 932/10 = 93.
Here is a sample run:
Enter a number between 0 and 1000: 999
The multiplication of all digits is 999 is 729

find the cost of your paper

This question has been answered.

Get Answer