Question: 7. Write a Java program that asks the user for a distance (in meters) and the time was taken (as three numbers: hours, minutes, seconds),

7. Write a Java program that asks the user for a distance (in meters) and the time was taken (as three numbers: hours, minutes, seconds), and display the speed, in meters per second, kilometers per hour and miles per hour (hint: 1 mile =1609 meters). Test Data Input distance in meters: 2500 Input hour: 5 Input minutes: 56 Input seconds: 23 Expected Output : Your speed in meters/second is 0.11691531 Your speed in km/h is 0.42089513 Your speed in miles/h is 0.26158804 8. Write a Java program that accepts two integers from the user and then prints the sum, difference, product, average, maximum (the larger of the two integers), and minimum (smaller of the two integers). Test Data Input 1st integer: 25 Input 2nd integer: 5 Expected Output : Sum of two integers: 30 Difference of two integers: 20 Product of two integers: 125 Average of two integers: 15.00 Max integer: 25 Min integer: 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
