Server Administration

A script reads a retry count as the text "9" and must increase it to 10 rather than produce "91". What should it do before adding 1?

Show the answer

Correct answerD. Convert the count to an integer

AWhy not this: Appending the character joins text and produces "91".

BWhy not this: Padding changes the text's formatting rather than preparing it for arithmetic.

CWhy not this: An array holds elements; enclosing text in one does not convert that text to a number.

DWhy this is right: Converting the text to an integer makes it suitable for arithmetic addition.

Converting numeric text to an integer allows arithmetic addition. Appending a character performs string concatenation, which would produce "91" rather than 10.