Question: CODE IN JAVA PLEASE Problem 2: Marathon race time calculator Assume that marathon runners run the same pace (e.g. 10 minutes per mile) for the

 CODE IN JAVA PLEASE Problem 2: Marathon race time calculator Assume

CODE IN JAVA PLEASE

Problem 2: Marathon race time calculator Assume that marathon runners run the same pace (e.g. 10 minutes per mile) for the entire length of a race. In this task, you are going to create a calculator to predict the runner's completion time in hours and minutes. Using JOptionPane, ask the user for 2 inputs. This will be the expected pace per mile in minutes and seconds. Consider asking twice (one number each time) and storing them in String variables. Then convert those variables to numbers. Assume the user is kind and will enter a number (you do not have to check the input before converting it to number. We will see how to do this later in the course.) A marathon is 26.2 miles. Given the pace per mile, calculate the total time it will take the runner to complete the race. For example, if the user inputs 10 minutes and 10 seconds per mile, the output should be 4 hours and 26 minutes. Use JOptionPane.showMessage Dialog() to display your result. In the output, give a complete sentence. For example "Your expected finish time is 4 hours and 26 minutes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!