https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d6d1f763-dcf2-45be-baaa-213f3a997fd2/Untitled.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/479211e9-53f0-445d-9158-58f0360a1f1b/Untitled.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/66a5a786-49ee-4162-89c0-2e0be1e37ae8/Untitled.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ee8cdbc5-f38c-464a-9047-94622a5334a7/Untitled.png

  1. Write a method called toMilesPerHour that has 1 parameter of type double with the name kilometersPerHour. This method needs to return the rounded value of the calculation of type long.

If the parameter kilometersPerHour is less than 0, the method toMilesPerHour needs to return -1 to indicate an invalid value.

Otherwise, if it is positive, calculate the value of miles per hour, round it and return it. For conversion and rounding, check the notes in the text below.

Examples of input/output:

  1. Write another method called printConversion with 1 parameter of type double with the name kilometersPerHour.

This method should not return anything (void) and it needs to calculate milesPerHour from the kilometersPerHour parameter.

Then it needs to print a message in the format "XX km/h = YY mi/h".

XX represents the original value kilometersPerHour. YY represents the rounded milesPerHour from the kilometersPerHour parameter.

If the parameter kilometersPerHour is < 0 then print the text "Invalid Value".

Examples of input/output: