CompTIA ITF+ (FC0-U61) — Question 140
A programmer is constructing an algorithm that predicts personality traits based on users’ selection of their favorite ice cream flavors. Which of the following programming concepts should be used to represent the flavor of ice cream?
Answer options
- A. Vectors
- B. Arrays
- C. Variables
- D. Constants
Correct answer: C
Explanation
The correct answer is C, Variables, because they allow for the storage of user-specific data such as their chosen ice cream flavor, which can change over time. In contrast, Constants (D) are fixed values that cannot be altered, making them unsuitable for this scenario, while Arrays (B) and Vectors (A) are used for collections of items rather than individual user preferences.