subject

Write a method so that the main() code below can be replaced by simpler code that calls method calcMilesTraveled(). Original main(): public class CalcMiles {
public static void main(String [] args) {
double milesPerHour = 70.0;
double minutesTraveled = 100.0;
double hoursTraveled;
double milesTraveled;
hoursTraveled = minutesTraveled / 60.0;
milesTraveled = hoursTraveled * milesPerHour;
System. out. println("Miles: " + milesTraveled);
}
}
1 import java. util. Scanner;
2
3 public class CalcMiles (
4
5 /" Your solution goes here ./
6 private double calcMilesTraveled(double milesPertour, double ninsTraveled)
7 double hoursTraveled
8 double milesTraveled;
9
10 hoursTraveled mibsTraveled 60.8
11 milesTraveled hoursTraveled milesperhour
12
13 return milesTraveled;
14
15
16 public static void main(String 0] args)
17 double milesPerhour 70.0;
18 double minutesTraveled 100.0
19
20 System. out. printin("Miles: mphAndMinutesToMiles(milesPerHour, minutesTraveled))i

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 13:00
The documents a system at the end of the design phase, identifies any changes since the beginning of the project, and includes testing and verification of all system requirements and features. functional baseline operational baseline allocated baseline product baseline
Answers: 1
question
Computers and Technology, 21.06.2019 21:30
Apower user needs you to install a second type of operating system on his computer to increase efficiency while running some specialized software programs. which installation technique should you use?
Answers: 3
question
Computers and Technology, 22.06.2019 20:50
What is the difference between windows 7 and windows 10?
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
Need getting google account back, big issue
Answers: 2
You know the right answer?
Write a method so that the main() code below can be replaced by simpler code that calls method calcM...
Questions
question
Mathematics, 31.05.2021 17:20
question
Mathematics, 31.05.2021 17:20
question
English, 31.05.2021 17:20