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 10:30
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
How often does colleges update the cost of attendance on their website? . a)every two years b) every four years c) every year d) every semester
Answers: 1
You know the right answer?
Consider the method getHours, which is intended to calculate the number of hours that a vehicle take...
Questions
question
World Languages, 31.12.2019 11:31
question
Mathematics, 31.12.2019 11:31
question
English, 31.12.2019 11:31
Questions on the website: 13722363