Question: Write an error-free Java program to do the following things. Generate a table of conversions from Miles Per Hour (MPH) to meters per second (m/s)

Write an error-free Java program to do the following things.

Generate a table of conversions from Miles Per Hour (MPH) to meters per second (m/s) for values from a min MPH value up to a max MPH value of 140. Display a line in the table for each 5 MPH.

The min MPH value needs to be input from the user. Assume that it will be a positive integer and it will be a multiple of 5.

Calculate the average of the m/s values in your table. Display the total number of entries in your table and the average m/s at the end of the table. (You must calculate the average within your program; i.e., do not calculate the average on a calculator and then display the value.)

Include a table heading and column headings in your print out. There is a formatting symbol (\t) that can be used in println statements that will tab over. For next formatting of output, I suggest (but not require) that you use printf().

You must use at least one while statement in your program.

Sample output (just the first few lines are shown):

MInput min MPH value: 10 MMM MMMConversion of MPH to m/s MMMMPH m/s MMM-------------------------- MMM10 4.470408940817882 MMM15 6.705613411226823 MMM20 8.940817881635764

Or in better format:

MInput min MPH value: 15 MMM MMMConversion of MPH to m/s MMMMPH m/s MMM-------------------------- MMM15 6.71 MMM20 8.94 MMM25 11.18

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!