(Average speed in miles) Assume a runner runs 14 kilometers in 45 minutes and 30 seconds. Write a program that displays the average speed in miles per hour. (Note that 1 mile is 1.6 kilometers.)
Solution
/**
Program - 10
(Average speed in miles)
Assume a runner runs 14 kilometers in 45 minutes and 30 seconds.
Write a program that displays the average speed in miles per hour.
(Note that 1 mile is 1.6 kilometers.)
**/
public class HelloWorld
{
public static void main(String args[])
{
System.out.println((14 / 45.30) / 1.6);
}
}
OUTPUT
0.19315673289183224
If you have any doubts or questions, please let me know.