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

CSE 240 MIDTERM QUESTIONS AND ANSWERS

Puntuación
-
Vendido
-
Páginas
31
Grado
A+
Subido en
18-06-2025
Escrito en
2024/2025

CSE 240 MIDTERM QUESTIONS AND ANSWERS

Institución
CSE 240
Grado
CSE 240











Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
CSE 240
Grado
CSE 240

Información del documento

Subido en
18 de junio de 2025
Número de páginas
31
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

CSE 240 MIDTERM QUESTIONS AND ANSWERS
What key feature of programming languages is supported by C++, but not Java? -
Answers :Pointers

In contrast to Web 1.0, what is the key function of Web 2.0? - Answers :Web is the
computing platform

What computing paradigm enforces stateless (no variable allowed) programming? -
Answers :Functional

What computing paradigm can solve a problem by describing the requirements, without
writing code in a step-wise fashion to solve the problem? - Answers :logic

What is the major improvement of structured programming languages over the earlier
programming languages? - Answers :Removing Goto statement from the language.

What is a feature of object-oriented computing? - Answers :encapsulation of states

What programming languages better prepare you for leaning database query languages
such as SQL and LINQ? - Answers :Prolog and Scheme

Event-driven computing paradigm is to: - Answers :define a set of events and write an
event handler for each event

What programming language characteristics impact the readability of the programs
written in this language? - Answers :Control structures, Syntax design, and Data
Structures

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 referred to as __________ . - Answers :Casting.

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

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

Can the identifier "base_variable" be created from the following BNF ruleset?

<char> ::= a | b | c | ... | s | ... | x | y | z
<identifier> ::= <char> | <char> <identifier> - Answers :No - there is an underscore in
the identifier name that cannot be generated.

ow many different identifiers can the following BNF ruleset generate?

<char> ::= a | b | c | ... | x | y | z
<identifier> ::= <char> | <char> <identifier> - Answers :More than 26.

Which commands (constructs) do NOT have a loop when expressed in syntax graphs?
Select all that apply - Answers :If-then-else, for ( <init-expr>; <test-expr>; <increment-
expr> ) {<statements>} , while (condition) do {statements;}

Given this snippet of code in C,

char alpha = 'a';
int numeric = alpha + 10;

which of the following statement is correct: - Answers :Syntactically correct, but
contextually incorrect.

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

Which implementation of a function has potentially the best performance in terms of
execution speed? - Answers :macro

Given the following code, what is the expected value for z?
#define func(x, y) (x > y) ? y++ : x++

,int main()
{
int x = 10;
int y = 9;
int z = func(x, y);
} - Answers :9

For the following BNF ruleset, which are terminal symbols? (Check all that apply.)

<char> ::= a | b | c | ... | x | y | z
<identifier> ::= <char> | <char> <identifier> - Answers :y, a

If a program contains an error that divides a number by zero at the execution time. This
error is a - Answers :semantic error

Java uses which of the following program processing? - Answers :Two Step Translation
with Intermediate Code -- (Compilation + Interpretation)

During compilation, linker is used for - Answers :resolving external references (bring in
code from other libraries).

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.

A final method in Java defines: - Answers :an in-line function

Type checking happens during compilation phase, it reinforces which of the following
structural layer? - Answers :Contextual

Given the C declaration: char s1[4], s2[ ] = "hello"; if a string copy function strcpy(s1, s2)
is executed, what will happen? - Answers :The result is s1 will contain the string "hell",
and the following two byte locations will contain 'o' an '\0'.

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,&a[0]

Assume this is a 32-bit environment, given a declaration: int a[10]; What is the size (in
bytes) of the entire array? - Answers :40

Which of the following orthogonality describe this example: If a block allows one
statement, it should allow zero or more statements 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 :outside any
class

The imperative programming paradigm is popular and is a part of object-oriented
computing paradigm, because it ____ (Select all answers that apply). - Answers :is
based on computer organization and thus is efficient to execute on hardware, matches
the culture of doing things by following the step-wise instructions.

Assume a variable 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.

What is NOT the purpose (functionality) of the forward declaration (prototype)? -
Answers :to allow functions to return different types of values.

Which of the following types is a C++ type, but NOT a C type? - Answers :bool

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

During data declaration, a name is binded to a memory location, what else can be
identify as part of this process? - Answers :Data type, Scope, Qualifier

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

(True or False) Sort orthogonality 1 and sort orthogonality 2 implies compositional
orthogonality. - Answers :True

C/C++ has 2 pointer operators, which operator will return the address of variable? -
Answers :Ampersand (&)

Multiple pointers can reference the same object. - Answers :True

Given the following code

char *p = "hello", *s = "this is a string";
strcpy(p, s);
printf("%s\n", p);

What will happen? - Answers :A run time error may occur at this line: strcpy(p, s);
$13.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


Documento también disponible en un lote

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Greaterheights Birkbeck, University of London
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
1120
Miembro desde
3 año
Número de seguidores
880
Documentos
18258
Última venta
3 días hace

4.1

216 reseñas

5
120
4
41
3
24
2
10
1
21

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