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

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 14PE
icon
Related questions
Question

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
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning