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.
Escuela, estudio y materia
- Institución
- CSE 240
- Grado
- CSE 240
Información del documento
- Subido en
- 20 de mayo de 2023
- Número de páginas
- 9
- Escrito en
- 2022/2023
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
cse 240 exam 1 review questions with complete solutions
Documento también disponible en un lote