CSE 240 Exam #1 Review QUESTIONS WITH COMPLETE SOLUTIONS
Lexical Rules correct answer: 1. Identifiers. Names (programmers chosen) for something of interest (variables, functions, methods, classes, etc.) 2. Keywords. names reserved by the language designer: if, switch, for, int, float, char, while, etc. 3. Operators. +, *, , =, !, &&, ||, etc. 4. Delimiters. , ; () {} 5. Literals. 5, 14.5, 'A', "Hello", 6. Comments. /* ... */, // ... 7. Putting together symbols, to create words 8. Variable names should start with a letter, '$', or '_'. Syntactic Rules correct answer: * Putting together words, to create sentences Semantic Rules correct answer: 1. Declaration and Unicity. Reviews for uniqueness and that the variable has been declared before its usage. 2. Types. Reviews that the types of variables match the values assigned to them. 3. Array's indexes. Reviews that the indexes are integers. 4. Conditions. Reviews that all the expressions on the conditions return a boolean value. 5. Return Type. Reviews that the value returned by a method matches the type of the method. 6. Parameters. Reviews that the parameters in a method match in type and number with the declaration of the method.
Written for
- Institution
- CSE 240
- Course
- CSE 240
Document information
- Uploaded on
- May 20, 2023
- Number of pages
- 9
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cse 240 exam 1 review questions with complete solutions
Also available in package deal