Prepare for the 241 Computer Science Certification Exam with comprehensive flashcards and multiple choice questions. Enhance knowledge with explanations and hints to excel in your test journey!

Multiple Choice

What term refers to the rules in a scripting language that govern punctuation, spelling, and grammar, such as ending a statement with a semicolon?

Syntax defines the rules for constructing valid program text. It covers how punctuation, keywords, and operators must be arranged to form well-formed statements, such as ending a statement with a semicolon to mark its end. When code follows these structural rules, the compiler or interpreter can parse it correctly. If the punctuation or order is off, the program runs into a syntax error because it doesn’t conform to the expected structure. Semantics, on the other hand, concerns what the code actually does when run—the meaning of each statement. Lexical rules deal with the basic tokens the language recognizes, such as identifiers and keywords, and how they’re spelled. Grammar is related to the rules of how tokens combine, but the common term for these practical rules about structure and punctuation in programming is syntax.

Syntax defines the rules for constructing valid program text. It covers how punctuation, keywords, and operators must be arranged to form well-formed statements, such as ending a statement with a semicolon to mark its end. When code follows these structural rules, the compiler or interpreter can parse it correctly. If the punctuation or order is off, the program runs into a syntax error because it doesn’t conform to the expected structure.

Semantics, on the other hand, concerns what the code actually does when run—the meaning of each statement. Lexical rules deal with the basic tokens the language recognizes, such as identifiers and keywords, and how they’re spelled. Grammar is related to the rules of how tokens combine, but the common term for these practical rules about structure and punctuation in programming is syntax.