Question: module project { package hotel.fivestar; import java.util.scanner; public class RunningLog { public static void main (string[] args) ( Scanner sc = new Scanner (system.in); //

module project {

package hotel.fivestar;

import java.util.scanner;

public class RunningLog {

public static void main (string[] args) (

Scanner sc = new Scanner (system.in);

// asking user to input the number of runs

System.out.print("Enter how many runs you want to run : ");

int noOfRuns = Integer.parseInt(sc.nextLine()); // taking the user input

// now iterating upto that numbers

for(int i=0;

double time,distance,averagePace; //variables to store the time and distance

// taking distance and time for each run

system.out.print(" Enter the distance in miles : ");

distance = Double.parseDouble (sc.nextLine());

System.out.print ("Enter the time taken to travel the distance : ");

time = Double.parseDouble (sc.nextLine());

// now displaying the average for each run

averagePace = time/distance;

System.out.println("Average pace of Run-"+(i+i)+" is : "+averagePace+"(minutes per mile)");

}

System.out.println(" Thank you for using my running Log Program");

}

}

}

Please use the code above to do the following requirements:

This weeks project work will build off the last one, Write a program that:

  1. Ask the user for number of runners
  2. For each runner:
    1. Ask the user the name of the runner
    2. Ask the user for number of runs
    3. For each run, ask the user
      1. What the distance was in miles (in decimal format, e.g. 3.1 miles is acceptable)
      2. What the time was in minutes (in decimal format, e.g. 23.9 minutes is acceptable)
  3. After gathering all the info from steps 1 & 2 above, output a summary in 3 sections:
    1. The name of each runner along with the average pace of each runner
    2. The average pace of all runs for all runners
    3. The total number of runners & runs

Note: In general, Project work will be more free-form than other assignments. So in this case, your input/output format is more up to you. Please make it as usable and readable to the user as possible.

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!