Question: CHALLENGE ACTIVITY 62 6.3.1: Methods: Factoring out a unit-conversion calculation. Write a method so that the main() code below can be replaced by the simpler
CHALLENGE ACTIVITY 62 6.3.1: Methods: Factoring out a unit-conversion calculation. Write a method so that the main() code below can be replaced by the simpler code that calls method mphAnd MinutesToMiles(). Original main(): public class CalcMiles { public static void main(String[] args) { double miles Perilour double minutes Traveled double hour traveled, double milestraveled, milesPerlour - scnr.nextDouble(); minutesTraveled - sonr.nextDouble(); hour traveled - minutesTraveled / 60.0 milestraveled - hours Traveled. milesPer Hour System.out.println("Miles: " + milesTraveled)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
