100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

CSE 240 Midterm exam questions answered correctly

Puntuación
-
Vendido
-
Páginas
28
Grado
A+
Subido en
26-03-2025
Escrito en
2024/2025

CSE 240 Midterm exam questions answered correctly Given: Very Simple Programming Language (VSPL) char ::= a | b | c | ... | z | 0 | 1 | ... | 9 operator ::= + | - | * | / | % | | | == | = | = variable ::= char | char variable expr ::= variable operator variable | ( expr ) operator ( expr ) assign ::= variable = expr; statements ::= assign | assign statements The following is valid: a = b + c + d; - ANSWERSfalse If you like to see accurate debugging information, which of the following program processing would you recommend? - ANSWERSInterpretation If your application is composed of multiple modules (programs), which of the following program processing would you recommend? - ANSWERSCompilation What is the main reason of applying two-step translation of high level programming language? - ANSWERSOne compiler for all machines What is "func" in this example? #include stdio.h #define func(x, y) (x y) ? y : x int main() { int x = 10; int y = 9; int z = func(x, y); } - ANSWERSA macro Assume a function requires 20 lines of machine code and will be called 10 times in the main program. You can choose to implement it using a function definition or a macro definition. Compared with the function definition, macro definition will lead the compiler to generate, for the entire program, ______ - ANSWERSa longer machine code but with shorter execution time. Given the following code, what is the expected value for z? #include stdio.h #define func(x, y) (x y) ? y : x int main() { int x = 10; int y = 9; int z = func(++x, y++); } - ANSWERS10 Explicit type conversion is commonly refer to as __________ . - ANSWERSCasting Which of the following orthogonality describe this example:

Mostrar más Leer menos
Institución
Grado

Vista previa del contenido

CSE 240 Midterm exam
questions answered
correctly
Given:
Very Simple Programming Language (VSPL)
<char> ::= a | b | c | ... | z | 0 | 1 | ... | 9
<operator> ::= + | - | * | / | % | < | > | == | >= | <=
<variable> ::= <char> | <char> <variable>
<expr> ::= <variable> <operator> <variable> | ( <expr> )
<operator> ( <expr> )
<assign> ::= <variable> = <expr>;
<statements> ::= <assign> | <assign> <statements>


The following is valid:


a = b + c + d; - ANSWERS>>>>>false


If you like to see accurate debugging information, which of the
following program processing would you recommend? -
ANSWERS>>>>>Interpretation


If your application is composed of multiple modules (programs),
which of the following program processing would you recommend? -
ANSWERS>>>>>Compilation


What is the main reason of applying two-step translation of high
level programming language? - ANSWERS>>>>>One compiler for all
machines


What is "func" in this example?

,#include <stdio.h>


#define func(x, y) (x > y) ? y : x


int main()
{
int x = 10;
int y = 9;
int z = func(x, y);
} - ANSWERS>>>>>A macro


Assume a function requires 20 lines of machine code and will be
called 10 times in the main program. You can choose to implement
it using a function definition or a macro definition. Compared
with the function definition, macro definition will lead the
compiler to generate, for the entire program, ______ -
ANSWERS>>>>>a longer machine code but with shorter execution
time.


Given the following code, what is the expected value for z?


#include <stdio.h>


#define func(x, y) (x > y) ? y : x


int main()
{
int x = 10;
int y = 9;
int z = func(++x, y++);
} - ANSWERS>>>>>10


Explicit type conversion is commonly refer to as __________ . -
ANSWERS>>>>>Casting


Which of the following orthogonality describe this example:

, If a block allows one statement, it should allow zero or more
statments within that same block. - ANSWERS>>>>>Number
Orthogonality


In the C-Style input function scanf("%d", &i); What does the
character "&" mean? - ANSWERS>>>>>scanf takes the address of an
variable as its parameter.


Where is the main() function located in a C or C++ program? -
ANSWERS>>>>>? main class


In C++, what function can be used to input a string with spaces?
- ANSWERS>>>>>cin.getline(...);


What is NOT the purpose (functionality) of the forward
declaration (prototype)? - ANSWERS>>>>>


A data type defines the - ANSWERS>>>>>values and operations
allowed


Assume a varible is declared in a block of code within a pair of
curly braces. The scope of the variable - ANSWERS>>>>>starts
from its declaration point and extends to the end of the block.


Given a C declaration: char a[] = "Hello World"; What can be
used as the initial address of array a[]? Select all correct
answers. - ANSWERS>>>>>*a[0]
&a[0] (check with professor)


Given a declaration: char a[] = "Hello World"; What is the size
(in bytes) of the array a[]? - ANSWERS>>>>>12 bytes


Which of the following C assignment statements (assign a value
to a variable at the semantic level) will NOT cause a
compilation error?
When evaluating a programming language the category Reusability
describes: - ANSWERS>>>>>This concept asks how tied down a
language is to a particular platform, can code be distributed
easily and can libraries be made and shared

Escuela, estudio y materia

Grado

Información del documento

Subido en
26 de marzo de 2025
Número de páginas
28
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$11.49
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
leonlangat942

Conoce al vendedor

Seller avatar
leonlangat942 EXAMS
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
1
Miembro desde
1 año
Número de seguidores
0
Documentos
68
Última venta
10 meses hace

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes