subject

Consider the method get Hours, 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, marker2)
{
/* missing statement */
return hours;
}
1. Which of the following statements can replace /* missing statement */ so getHours works as intended?
(A) double hours = (Math. abs (marker1) - Math. abs (marker2)) / 60.0;
(B) double hours = Math. abs (marker1 - marker2 / 60.0)
(C) double hours = Math. abs (marker1 - marker2) / 60.
(D) double hours = Math. abs((marker1 - marker2) / 60);
(E) double hours = (double) (Math. abs (marker1 - marker2) / 60);

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 05:00, brylove603
Pls do you believe that the use of 3d animation has grown in feature films over the last few years? if so, do you think the trend will continue? what are the forces driving this trend?
Answers: 2
image
Computers and Technology, 23.06.2019 16:00, lokaranjan5736
Write a grading program for a class with the following grading policies: a. there are two quizzes, each graded on the basis of 10 points. b. there is one midterm exam and one final exam, each graded on the basis of 100 points. c. the final exam counts for 50% of the grade, the midterm counts for 25%, and the two quizzes together count for a total of 25%. (do not forget to normalize the quiz scores. they should be converted to a percentage before they are averaged in.) any grade of 90 or more is an a, any grade of 80 or more (but less than 90) is a b, any grade of 70 or more (but less than 80) is a c, any grade of 60 or more (but less than 70) is a d, and any grade below 60 is an f. the program will read in the student’s scores and output the student’s record, which consists of two quiz and two exam scores as well as the student’s average numeric score for the entire course and final letter grade. define and use a structure for the student reco
Answers: 2
image
Computers and Technology, 24.06.2019 08:00, ineemorehelp
Arah has entered data about football players from team a and team b in a worksheet. she enters names of players from team a with details about each player in different columns of the worksheet. similarly, she enters details of all the players from team b. which option will her view the data for team a and team b in two separate sections after printing? a. page break view b. freeze pane view c. split screen view d. full screen view e. zoom out view
Answers: 1
image
Computers and Technology, 24.06.2019 13:50, Estefaniamarilicolin
What does code do? a creates a text box that says "solid black" b creates a black border of any width c creates a black border 1 pixel wide
Answers: 1
You know the right answer?
Consider the method get Hours, which is intended to calculate the number of hours that a vehicle tak...

Questions in other subjects:

Konu
Chemistry, 12.05.2021 18:50
Konu
Mathematics, 12.05.2021 18:50