The general speed limits in the Philippines in 60 km/h on most highways and 100 km/h on expressways. Your goal here is to compute the speed of automobiles based on distance travelled and time taken to cover this distance. Note: For this problem, you need to format the output to print the appropriate number of decimal places. You need to use System.out.format (Read: https://docs.oracle.com/javase/tutorial/java/data/numberformat.html) Input The input is composed of four positive integers representing the distance traveled in meters, and the 3 other inputs representing the time in hours, minutes, and seconds it took to cover the given distance. 2500·5·56·23 Output Output should contain 3 computed speeds i.e. meters/second, kilometers/hour, and miles per hour (note that a mile is equivalent to 1609 meters) separated by a space. 0.12·0.42·0.26
The general speed limits in the Philippines in 60 km/h on most highways and 100 km/h on expressways. Your goal here is to compute the speed of automobiles based on distance travelled and time taken to cover this distance.
Note: For this problem, you need to format the output to print the appropriate number of decimal places. You need to use System.out.format (Read: https://docs.oracle.com/javase/tutorial/java/data/numberformat.html)
Input
The input is composed of four positive integers representing the distance traveled in meters, and the 3 other inputs representing the time in hours, minutes, and seconds it took to cover the given distance.
Output
Output should contain 3 computed speeds i.e. meters/second, kilometers/hour, and miles per hour (note that a mile is equivalent to 1609 meters) separated by a space.
Step by step
Solved in 2 steps