nerdexam
CompTIA

FC0-U61 · Question #407

Which of the following BEST explains the use of float over integer to store monetary values?

The correct answer is D. It supports decimals.. Float is a data type that can store decimal or fractional numbers, such as 3.14, 0.5, or -2.75. Float would be the best data type to use for storing monetary values because monetary values often involve decimals, such as $1.99, 0.25,or-5.50. Integer is a data type that can only s

Software Development

Question

Which of the following BEST explains the use of float over integer to store monetary values?

Options

  • AIt accepts negative values.
  • BIt stores symbols
  • CIt accommodates larger values.
  • DIt supports decimals.

How the community answered

(59 responses)
  • A
    2% (1)
  • B
    3% (2)
  • C
    2% (1)
  • D
    93% (55)

Explanation

Float is a data type that can store decimal or fractional numbers, such as 3.14, 0.5, or -2.75. Float would be the best data type to use for storing monetary values because monetary values often involve decimals, such as $1.99, 0.25,or-5.50. Integer is a data type that can only store whole numbers, such as 1, 0, or -2. Integer would not be suitable for storing monetary values that have decimals. The other options are not data types that can store numerical values.

Topics

#data types#float#integer#programming fundamentals

Community Discussion

No community discussion yet for this question.

Full FC0-U61 Practice