Answer:
import java.util.Scanner;
public class LapToMiles {
public static void main(String[] args) {
System.out.println("Enter Number of Miles");
Scanner in = new Scanner(System.in);
double numMiles = in.nextDouble();
double numberOfLaps = milestoLaps(numMiles);
System.out.printf("%.2f",numberOfLaps);
}
public static double milestoLaps(double numMiles){
//One lap = 0.25 miles
double numberOfLaps = numMiles/0.25;
return numberOfLaps;
}
}
Explanation:
Create a Method milestoLaps that converts number of laps to number of miles
Within the main method call milestoLaps and pass your entered value for miles
format the output with printf()