FC0-U61 · Question #881
A developer is writing a script to calculate a bank account balance within two decimal places. Which of the following data types should the developer select to store the balance?
The correct answer is C. Float. A float is a data type that can store decimal numbers, such as 3.14 or 0.01. This is suitable for calculating a bank account balance within two decimal places, as it can represent fractions of a dollar. A boolean is a data type that can only store true or false values, which is n
Question
A developer is writing a script to calculate a bank account balance within two decimal places. Which of the following data types should the developer select to store the balance?
Options
- ABoolean
- BInteger
- CFloat
- DChar
How the community answered
(22 responses)- C95% (21)
- D5% (1)
Explanation
A float is a data type that can store decimal numbers, such as 3.14 or 0.01. This is suitable for calculating a bank account balance within two decimal places, as it can represent fractions of a dollar. A boolean is a data type that can only store true or false values, which is not useful for numerical calculations. An integer is a data type that can store whole numbers, such as 1 or 100, but not decimals. A char is a data type that can store a single character, such as a' or 9', but not multiple characters or decimals.
Topics
Community Discussion
No community discussion yet for this question.