subject

Consider the method getHours, which is intended to calculate the number of hours that a vehicle takes to travel between two mile markers on a highway if the vehicle travels at a constant speed of 60 miles per hour. A mile marker is a sign showing the number of miles along a road between some fixed location (for example, the beginning of a highway) and the current location. The following table shows two examples of the intended behavior of getHours, based on the int parameters marker1 and marker2. marker1 marker2 Return Value
100 220 2.0
100 70 0.5
Consider the following implementation of getHours.
public static double getHours(int marker1, int marker2) { /* missing statement */ return hours; }
Which of the following statements can replace /* missing statement */ so getHours works as intended?
A. double hours = (Math. abs (markerl) - Math. abs (marker2)) / 60.0;
B. double hours = Math. abs (markeri - marker2 / 60.0)
C. double hours = Math. abs (marker1 - marker2) / 60.0;
D. double hours = Math. abs((markeri - marker2) / 60);
E. double hours = (double) (Math. abs (marker1 - marker2) / 60);

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:00
If a client wants to make minor edits, what should he/she use?
Answers: 3
question
Computers and Technology, 23.06.2019 01:30
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
Perform an online search about the booting process of a computer and list all the steps
Answers: 2
question
Computers and Technology, 24.06.2019 01:00
What are two ways to access the options for scaling and page orientation? click the home tab, then click alignment, or click the file tab. click the file tab, then click print, or click the page layout tab. click the page layout tab, or click the review tab. click the review tab, or click the home tab?
Answers: 2
You know the right answer?
Consider the method getHours, which is intended to calculate the number of hours that a vehicle take...
Questions
Questions on the website: 13722367