Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago