A company needs to develop a feature for their website that will show a discount message if a user is a VIP customer and if the current day is a holiday. Which type of data should be used to store the 'VIP customer' and 'current day is a holiday' values?
The correct data type for representing 'VIP customer' and 'current day is a holiday' values is Boolean. Boolean data types are used to represent true/false or yes/no conditions. This is suitable for checking whether a customer is a VIP (true or false) and whether the current day is a holiday (true or false). Characters and numbers are not appropriate for this scenario since they are not intended for binary conditions.
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 Boolean data type?
Open an interactive chat with Bash
Why can't we use Integer, Char, or Float for the VIP and holiday status?