1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Darina [25.2K]
2 years ago
6

Consider the method get Hours, which is intended to calculate the number of hours that a vehicle takes to travel between two mil

e 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. IN The following table shows two examples of the intended behavior of getHours, based on the int parameters markeri and marker2. marker1 marke 100 220 100 700.5 Consider the following implementation of getHours. public static double getHours (int markeri, int ON 20 | 2 15. . . e no E /* 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);
Computers and Technology
1 answer:
mr Goodwill [35]2 years ago
7 0

Answer:

Replace the comment with:

(c) double hours = Math.abs (marker1 - marker2) / 60.0;

Explanation:

See attachment for right presentation of question

Analyzing the options:

(a): May return a negative result

This option will return a negative value if marker1 is less than marker2 because it subtracts the absolute value of marker2 from the absolute value marker1.

This literally is not different from marker1 - marker2

(b): Incorrect expression

This divides only marker2 by 60, then subtracts the quotient from marker1. This is not the expected expression.

(c) This option is correct

This correctly calculate the positive difference between marker1 and marker2 and the result is divided by 60.0 (note 60.0 not 60)

(d) & (e) Integer division

When a variable declared as double is divided by an integer variable or value, the result of the computation is not always accurate due to approximation

You might be interested in
3. Radheshree has to complete her assignment and submit it on the next day. While typing
Dafna1 [17]

Answer:

she can use the onscreen keyboard

this application is present in accessories file in the windows

5 0
2 years ago
Ses
jekas [21]

Answer:

Amoung us

Explanation:

When the imposter is sus

8 0
3 years ago
A certain manager makes the following statement "Our internet company is in business for the money, making profits, and making t
julia-pushkina [17]

Answer:

d. Stockholder theory

Explanation:

The theory of maximising profits

8 0
3 years ago
What are the main techniques used to help manage test anxiety? Check all that apply.
Aleks04 [339]

Answer:

1) Avoid the perfectionist of trap

2)Banish the negative thoughts

3) Get enough sleep

4) Make sure you are prepared

5) take deep breaths

Explanation:

In my thought it's the answer of this question.

4 0
2 years ago
Read 2 more answers
The ______ manages the hardware components including the cpu, memory storage, and peripheral devices. options operating system d
Alexandra [31]
The answer is the os or operating system
8 0
2 years ago
Other questions:
  • How many different integers can be represented with a 4-digit number in base 13?
    8·1 answer
  • Whats the best c++ compiler
    9·1 answer
  • Match the academic requirements with the careers. Technical program , bachelors degree, doctorate degree can go with cosmetologi
    7·2 answers
  • One of the advantages of off-the-shelf software is that ________________. a. the software contains important features, thus elim
    13·1 answer
  • C++ CODE
    6·1 answer
  • What is the encryption cipher that was the precursor to des??
    5·1 answer
  • Adrian wants to run a digital movie clip that his friend shared with him through email. His system has 2 GB of RAM and 20 GB of
    15·1 answer
  • How does a junction table handle a many-to-many relationship?
    10·1 answer
  • Brainliest for correct answer
    13·2 answers
  • After you log in to PowerPoint Online, what is the first thing you need to do to start creating a presentation?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!