Question: problem 6.7 page 235, Introduction of java Programming 10th edition, 1)Write a method that computes future investment value at a given interest rate for a

problem 6.7 page 235, Introduction of java Programming 10th edition, 1)Write a method that computes future investment value at a given interest rate for a special number of years. The future investment is determined using the formula in Programming Exercise 2.21 Use the following method header:

public static double futureInvestmentValue(

double investmentAmount, double monthlyInterestRate, int years)

for example, futureInvestmentValue(10000, 0.05/12, 5) reutrns 12833.59

write a test program that prompts the user to enter the investment amount (e.g., 1000) and interest rate (e.g., 9%) and prints a table that displays future value for the years from 1 to 30 as shown below:

the amount invested: 1000 (enter0

Annual interest rate: 9 (enter)

1 1093.83

2 1196.41

...

29 13467.25

30 14730.57

problem 2) (convert milliseconds to hours, minutes, and seconds) Write a method that converts mill, to hours, minutes, and seconds using the following header:

public static String convertMillis(long millis)

the method returns a string as hours:minutes:seconds. for example, convertMillis(5500) returns a string 0:05, convert Millis(100000) returns a string 0:1:40, and convertMillis(555550000) returns a string 154:19:10.

problem 3)The area of a pentagon can be computed using the following formula: AREA = 5xs^2 / 4xtan(pie/5)

write a mthod that returns athe area of a pentagon using the following header:

public static double area(double side)

write a main method that prompts the user to enter the side of a pentagon and display its area. Here is a sample run:

Enter the side:5.5 (enter)

The area of the pentagon is 52.04444136781625

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!