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, 21.06.2019 16:30
Which type of computing device is best suited to having a digital pen as an input device? a. personal computer b. personal digital assistant c. smart television d. laptop e. mobile phone
Answers: 3
question
Computers and Technology, 23.06.2019 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
question
Computers and Technology, 24.06.2019 00:00
Afashion designer wants to increase awareness about her brand. which network can she use and why she can use the blank to blank her products online. answers for the first blank: internet, extranet, or intranet answers for the second blank: market, design, and export
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
For which utilities, if any, does the landlord pay?
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
question
English, 03.11.2019 04:31
Questions on the website: 13722363