Scripting and Programming - Foundations - C173 (Unit 2. Exam Review, VERIFIED.
Scripting and Programming - Foundations - C173 (Unit 2. Exam Review, VERIFIED. In mathematics, minus is often written using a wide segment known as an emdash: —. However, in programming, only the hyphen symbol - may be used, since that character exists on a keyboard. ( ) - -Items within parentheses are evaluated first [ ] - -Replaced by ( ) In mathematics, subexpressions may be enclosed in parentheses ( ), by brackets [ ] as above, or even by braces { }, to improve readability. In programming, typically only parentheses are allowed. Brackets and braces are typically used for other purposes in programs. * / - -Next to be evaluated are * and /, having equal precedence. + - - -Finally come + and - with equal precedence. × - -* In mathematics, the symbol for multiplication is usually × or a dot, as in a × y, or a · y. However, in programming, only keyboard characters may be used, so the symbol used is *. = is not equals - -In programming, = is an assignment of a left-side variable with a right-side value. = is NOT equality as in mathematics. Thus, x = 5 is read as "x is assigned with 5", and not as "x equals 5". When one sees x = 5, one might think of a box labeled x having the value 5 put in. A program determines if the number of people admitted to a concert venue exceeds the maximum seats of 1500. How should the item to hold the maximum seats be declared? - -(Constant integer maxSeats)The maximum number of seats for the venue is fixed and will not change, so a constant should be used. The number of seats is countable, so the type should be an integer.
Geschreven voor
Documentinformatie
- Geüpload op
- 24 augustus 2023
- Aantal pagina's
- 7
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
scripting and programming foundations c173 un
Ook beschikbaar in voordeelbundel