48. Which data type should be used for this purpose?

Answer: B

Explanation:

Boolean data type should be used to indicate whether a person has a college degree.

A Boolean data type is ideal for storing binary values, such as true or false, which fits perfectly for indicating the presence or absence of a college degree.

A) Character string

A character string is not suitable for this context as it is typically used to store text data. While it could technically represent "yes" or "no," it is not efficient or appropriate for a binary choice, especially when a Boolean type is readily available.

B) Boolean

The Boolean data type is the most suitable option because it directly represents two states: true (indicating the presence of a college degree) and false (indicating the absence). This makes it both space-efficient and semantically clear for the application’s requirements.

C) Integer

An integer could be used to represent a binary state (e.g., 1 for yes and 0 for no), but it is less clear than using a Boolean type. Using integers for this purpose can lead to misunderstandings and errors in the interpretation of the values.

D) Floating point

A floating point data type is inappropriate for this scenario as it is designed to represent decimal numbers, which are not needed for a simple true/false indication. It would unnecessarily complicate the data handling when a Boolean is sufficient.

Conclusion

The Boolean data type is definitively the right choice for indicating whether a person has a college degree due to its simplicity and clarity in representing binary states. All other options either complicate the data structure unnecessarily or do not provide the appropriate representation of the required information.