nerdexam
CompTIA

220-1002 · Question #411

A technician wants to write a script that will check data line by line until the end of the file. Which of the following elements will perform the check?

The correct answer is A. Loop. A loop is a programming construct that repeats a block of code until a specified condition is met - in this case, reading each line until the end of the file (EOF) is reached. Common examples include 'while' loops and 'for' loops. An Integer (B) is a numeric data type used to…

Hardware and network troubleshooting

Question

A technician wants to write a script that will check data line by line until the end of the file. Which of the following elements will perform the check?

Options

  • ALoop
  • BInteger
  • CString
  • DVariable

How the community answered

(25 responses)
  • A
    92% (23)
  • C
    4% (1)
  • D
    4% (1)

Explanation

A loop is a programming construct that repeats a block of code until a specified condition is met - in this case, reading each line until the end of the file (EOF) is reached. Common examples include 'while' loops and 'for' loops. An Integer (B) is a numeric data type used to store whole numbers. A String (C) is a data type used to store text. A Variable (D) is a named container that holds a value. None of B, C, or D perform iteration; only a loop has the ability to repeatedly process data sequentially until a termination condition (like EOF) is satisfied.

Topics

#scripting#loops#control flow#automation

Community Discussion

No community discussion yet for this question.

Full 220-1002 Practice