Chapter 2 Outcomes
Basic Programming Language Concepts
Knowledge Outcomes
Define each of the key terms listed in the chart below.
| reserved words | keywords | identifiers or names |
| Extended Backus-Naur Form (EBNF) |
metalanguage | production rules |
| syntactic variables | terminal tokens | simple data types |
| int | real | string |
| boolean | exponent form | ** + - / * |
| precedence of operations | div | round |
| truncation | mod | catenation |
| "+" operator overload | length | repeat |
| comparison operators | logical operators | initialize variables |
| enum | succ | pred |
| ord | output formatting | comments |
State the two rules for creating identifiers. Discuss the role of upper and lower case letters when creating identifiers (2.1).
In the metalanguage definition (2.1), state the purpose of each of the following symbols:
State the four simple data types found in Turing, and give examples of how they are used (2.2).
Name the two limitations that immediately occur when a variable is declared (2.3).
Understand and distinguish between each of the following (2.4):
State the order of precedence and the purpose of each of the following arithmetic operators (2.4):
Explain the use of catenation and substring selection (2.4).
Explain why the + operator is said to be overloaded (2.4).
Describe how the length of a string can be determined (2.4)
State the 6 comparison operators, and the 2 logical (boolean) operators (2.4).
Describe the general form of an assignment statement and give examples of int, real, string, and boolean assignment statements (2.5).
Describe what is meant when a boolean assignment is short circuited (2.5).
State the purpose of constants (2.5).
Explain what each of the following commonly used assignment statements accomplish (2.5):
Describe how to use the enumerated data type, including the use of the succ, pred, and ord functions (2.5).
Describe the method used to correctly output tables of numbers or words using output formatting (2.6).
Discuss the importance of comment statements in all programs (2.7).
Skills Outcomes
Take smaller sections of a string from a larger string, and build large strings from smaller strings (2.4).
State the purpose of the repeat function and show how it is used (2.4).
Show how assignment statements can be combined with variable declarations to initialize the value of the variable (2.5).