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]
3 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]3 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
In order to be compliant with the NIST publications, policies must include key security control requirements. One of these key r
lesya692 [45]

Answer:

True

Explanation:

In order to be compliant with the NIST publications, policies must include key security control requirements. One of these key requirements includes certification and accreditation, which is a process that occurs after the system is documented, controls tested, and risk assessment completed. It is required before going live with a major system. Once a system is certified and accredited, responsibility shifts to the owner to operate the system is a true statement.

8 0
3 years ago
10. What is "bandwidth"? (
natali 33 [55]

Answer:

ELECTRONICS

a range of frequencies within a given band, in particular that used for transmitting a signal.

2.

the energy or mental capacity required to deal with a situation.

Explanation:

6 0
3 years ago
What are the advantages of renting a home over buying a home? What are some disadvantages?
weqwewe [10]
An advantage of renting a home is that you don't have to fix any appliances or structures of the home your landlord does that for you. disadvantages are you have to follow their rules, you can't change anything on the inside like the paint or add a room to the home. in the state of Washington and landlord can evict you with only 20 days notice if they want to permanently sell the property. that's called a no-fault eviction. that's all I can think of hope that helps
7 0
3 years ago
In his article, “How to Publish Without Perishing,” what does James Gleick believe most people do when they really read a book?
jonny [76]

Answer:

James Gleick believes that they immerse themselves in a rich textual world. The answer is C.

3 0
2 years ago
Read 2 more answers
__________(fill in the blank) in online education refer(s) to how online education impacts students of a specific economic group
amid [387]

Answer:

I believe it's accessibility

Explanation:

Because it makes the most sense

7 0
2 years ago
Other questions:
  • Lance has three tables in his database he wants to generate a report to show the data from the three table so he decides to link
    6·2 answers
  • Match the part of motherboard to its function
    15·1 answer
  • There are a few simple rules that you can follow to store and manage files and folders in your computer. What is the most import
    9·2 answers
  • Write a function called simulate_several_key_strikes. It should take one argument: an integer specifying the number of key strik
    7·1 answer
  • What does remedy mean
    7·2 answers
  • What is the ethical danger of using agents in negotiation?
    15·1 answer
  • What would happen if computers only had input devices?
    9·1 answer
  • MODERATOR DELETE MY ACC
    8·2 answers
  • Discuss new concepts that you have learned about Cisco Devices and how they will be helpful in the workplace.
    11·1 answer
  • What are 2 ways to send a message to your client when signed in as an accountant user?.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!