You are working as a data analyst and need to calculate the average sales for a week. The sales amounts are: $150.75, $200.50, $100.25, $175.00, $130.50, $160.75, and $210.00. What data type should you use to store these sales amounts?
The correct data type to use for storing these sales amounts is a float. Floats are used to represent numbers that can contain fractional parts, which is necessary for accurately representing the sales amounts with decimal points. Other data types like integers and Booleans are not appropriate in this scenario as they cannot represent decimals.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a float data type?
Open an interactive chat with Bash
Why can't I use an integer for sales amounts?
Open an interactive chat with Bash
What are some other data types, and when should they be used?