Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

2. (1 point) Given AABC, tan A b b

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago