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
Suppose you have a string matching algorithm that can take in (linear)strings S and T and determine if S is a substring (contigu
Zielflug [23.3K]

Answer:

no seishsssssssssssssssssssss

8 0
3 years ago
Read 2 more answers
When are the malls going to open
Amiraneli [1.4K]
Idk maybe at 6:00pm today cuz most of the malls are close. Happy Thanksgiving! :D
3 0
3 years ago
Read 2 more answers
Why might you use the More button in the Find and Replace dialog box?
den301095 [7]

Answer:

Use the More button to display more options to help narrow the search criteria.

Explanation:

<em> I think hope this helps you!!</em>

6 0
3 years ago
An electronic ____ is an application you use to perform numeric calculations and to analyze and present numeric data.
attashe74 [19]

An electronic \sf\purple{spreadsheet} is an application you use to perform numeric calculations and to analyze and present numeric data.

\bold{ \green{ \star{ \orange{Mystique35}}}}⋆

7 0
3 years ago
This motherboard already has 1GB of RAM installed in the DIMM1 slot. The customerwould like to upgrade to 4GB total memory, use
Luden [163]

Answer:

The two phases to the context of this discussion are listed follows.

Explanation:

  • <u>Solution 1</u>: Delete 1 GB of current RAM as well as install another DIMM0 Chan A slot through one 2 GB of double-channel RAM. (thinkable unless the 2 GB RAM is provided by the motherboard in what seems like a DIMM0 Chan A slot)  
  • <u>Solution 2</u>: whether there's an unused or blank slot, perhaps one 1 GB dual-channel Ram could be mounted in some other slot at around the same speed or frequency.  

It's quite safer to mount memory with appropriate frequencies across both situations.

6 0
3 years ago
Other questions:
  • Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
    7·1 answer
  • What term is used to describe the harassment of computer users through various forms of internet communications?
    5·1 answer
  • Which description of the plain text file format is most accurate?
    10·1 answer
  • What three things in the third generation of computing helped get programming enthusiasts more involved with computers? Select 3
    12·2 answers
  • How do you change your grade level
    10·1 answer
  • Which of the following events happened first
    15·2 answers
  • The science of how an object reacts to its motion through air is called _______________. (12 letters)
    13·2 answers
  • ________ is a group meeting-based process for requirements collection. a. Reverse engineering b. Joint application design c. Hum
    9·1 answer
  • To improve readability and maintainability, you should declare ________ instead of using literal values such as 3.14159.
    14·1 answer
  • if a manager identifies numerous data integrity issues, she/he should consider the reports generated from that data as invalid a
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!