A script compares queue-length strings "9" and "10" and hostnames "WEB01" and "web01". Which comparisons evaluate to true when numeric comparisons use decimal values and text comparisons use case-sensitive lexicographic order? (Choose three.)
Choose 3 answers
Show the answer
Correct answersC. Text: "WEB01" does not equal "web01"E. Numeric: "9" is less than "10"F. Text: "9" is greater than "10"
AWhy not this: Lexicographic comparison compares the first characters, and "9" sorts after "1".
BWhy not this: Decimal 9 is smaller than decimal 10, regardless of their string lengths.
CWhy this is right: The different letter cases make the hostname strings unequal under case-sensitive comparison.
DWhy not this: Case-sensitive equality treats uppercase and lowercase letters as different.
EWhy this is right: Interpreted as decimal numbers, 9 is less than 10.
FWhy this is right: The first character "9" sorts after the first character "1" in lexicographic digit order.
Numeric comparison places 9 below 10; lexicographic comparison places "9" above "10" because their first characters determine the order. Case-sensitive equality distinguishes "WEB01" from "web01"; treating numeric-looking text as numeric would give the wrong text-comparison result.