Final answer:
The best data structure for storing the number of units sold across 20 locations is an array of int, as it provides a fixed-size, memory-efficient way to store whole number counts.
Step-by-step explanation:
If a supermarket needs to store the number of units sold of a particular product across their 20 locations, the best data structure to use would be d) an array of int because the number of locations is known. This data structure is static in size, which makes it efficient for storing a fixed number of integer values, such as the count of products sold at each location.
Unlike an ArrayList, which is dynamically resizable and typically used when the number of elements can change, an array is a simpler and more memory-efficient choice when the size is fixed. Additionally, we choose an array of int rather than Double because the number of units sold would be a whole number.