100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

CSE 240 Exam #1 Review UPDATED ACTUAL Exam Questions and CORRECT Answers

Rating
-
Sold
-
Pages
9
Grade
A+
Uploaded on
20-08-2025
Written in
2025/2026

CSE 240 Exam #1 Review UPDATED ACTUAL Exam Questions and CORRECT Answers 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 '_'

Show more Read less
Institution
CSE 240
Course
CSE 240









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CSE 240
Course
CSE 240

Document information

Uploaded on
August 20, 2025
Number of pages
9
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

CSE 240 Exam #1 Review UPDATED
ACTUAL Exam Questions and CORRECT
Answers
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.


Syntactic vs. Semantic - CORRECT ANSWER - Syntactic is if the sentence follows the
correct format, semantic is if the sentence makes sense.


*(a + i) = a[i] - CORRECT ANSWER - Tricky Examples:

, *(a + (i + 1)) != *(a + i) + 1;
/*
This does not shift the letters over to the right by 1.
* e.g. *(a + (i + 1));
It increments the value of i by 1.
Meaning a String of "2020" would become "3131".
*/


*(*(a + i) + j) == a[i][j];


Lexical Errors in C Examples - CORRECT ANSWER - int 1dog; // Can't start with anything
except for a letter, '$', or a '_'.
int ch(um; // Using a delimiter.
char[] x = 'hello there"; // Must have matching quotations and properly closed quotations.
( ) { } [ ] each one is 1 word: '(' = 1 word and ')' = 1 word.
"==" is one word.


Syntactic Errors in C Examples - CORRECT ANSWER - (a1 / a2) = (c3 - c4) // Can't set
expressions equal to each other.
p4rd2 = (x + y) hi (a / z);
struct dog { } // Needs a semicolon afterwards.
if (1} { } // Doesn't match parentheses


Semantic Errors in C Examples - CORRECT ANSWER - x = 5; // Valid even if x hasn't been
declared.
while (5) {if (6) { }}


Default Declarations and Sizes of Data Types in C - CORRECT ANSWER - int x = signed
short int

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
MGRADES Stanford University
View profile
Follow You need to be logged in order to follow users or courses
Sold
1069
Member since
1 year
Number of followers
102
Documents
68976
Last sold
22 hours ago
MGRADES (Stanford Top Brains)

Welcome to MGRADES Exams, practices and Study materials Just think of me as the plug you will refer to your friends Me and my team will always make sure you get the best value from the exams markets. I offer the best study and exam materials for a wide range of courses and units. Make your study sessions more efficient and effective. Dive in and discover all you need to excel in your academic journey!

3.8

169 reviews

5
73
4
30
3
44
2
8
1
14

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions