Which pseudocode line creates a two-dimensional array?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Prepare for the CompTIA ITF+ Certification Exam with flashcards and multiple choice questions. Understand key IT concepts and improve your skills with explanations at every step. Ensure your success with a comprehensive study approach.

The line that creates a two-dimensional array is the one that specifies two dimensions for the array. In this case, declaring "Logons(9,1) as string" indicates that the array will have two indices, which means it can store data in a grid or matrix format with 10 rows (0 to 9) and 2 columns (0 and 1). This is characteristic of a two-dimensional array, where you could access elements using two indices, such as Logons[row][column].

In contrast, the other options either do not define a second dimension or use a different syntax. For example, "Logons(9)" would create a one-dimensional array with 10 elements, and "array Logons(10)" is ambiguous but does not specify two dimensions. Therefore, the structure defined in the correct answer effectively demonstrates the capability to hold data in a two-dimensional format, affirming its correctness for the question asked.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy