Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

CSE 240 EXAM -1 REVIEW QUESTIONS WITH VERIFIED ACCURATE ANSWERS

Beoordeling
-
Verkocht
-
Pagina's
6
Cijfer
A+
Geüpload op
28-03-2026
Geschreven in
2025/2026

CSE 240 EXAM -1 REVIEW QUESTIONS WITH VERIFIED ACCURATE ANSWERS

Instelling
CSE 240
Vak
CSE 240

Voorbeeld van de inhoud

CSE 240 EXAM #1 REVIEW QUESTIONS WITH
VERIFIED ACCURATE ANSWERS

Lexical Rules - Answers - 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 - Answers - * Putting together words, to create sentences

Semantic Rules - Answers - 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 - Answers - Syntactic is if the sentence follows the correct
format, semantic is if the sentence makes sense.

*(a + i) = a[i] - Answers - 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 - Answers - 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 - Answers - (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 - Answers - x = 5; // Valid even if x hasn't been
declared.
while (5) {if (6) { }}

Default Declarations and Sizes of Data Types in C - Answers - int x = signed short int
(int) sizeof(x) = 4 bytes;

char x = unsigned char;
No long or short char, equivalent of byte in Java.
(int) sizeof(c) = 1 byte;

float and double remain the same.

Array Declaration - Answers - char x[] = "abc";
char x[] = {a, b, c}; // Doesn't have null terminator.

char a[5] = {'a', 'b', 'c', '\0'}
char *b = a; // This is valid.

malloc and free Declarations - Answers - You can't overwrite the pointer to the data
within the heap, then be able to free the space as you'd overwrite the reference.

Array Declaration:
int *y = (int*) malloc(sizeof(int) * numElements);

for (int i=0, i<4; i++) {
free(y[i]);
}
free(y);

2D Array Declaration:
int** array = (int**) malloc(sizeof(int*) * rows);

for (int i = 0; i < rows; i++) {
array[i] = (int*) malloc(sizeof(int) * cols);

Geschreven voor

Instelling
CSE 240
Vak
CSE 240

Documentinformatie

Geüpload op
28 maart 2026
Aantal pagina's
6
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$13.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF


Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
GEEKA YALA UNIVERSITY
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
2109
Lid sinds
4 jaar
Aantal volgers
1446
Documenten
54408
Laatst verkocht
1 week geleden

3.8

358 beoordelingen

5
177
4
61
3
48
2
17
1
55

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen