Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 9 páginas
Examen

Programming II Final Exam Questions With Complete SolutionS!

Document preview thumbnail
Vista previa 2 fuera de 9 páginas

A one-dimensional array can be initialized at the time it is defined, but a two-dimensional array cannot be initialized at the time it is defined. - ANSWERSFalse A(n) _________________ array is like several arrays of the same type put together. - ANSWERStwo dimensional To pass an array to a function, in the actual call you pass the ______________________ of the array. - ANSWERSname To access an array element, use the array name and the element's - ANSWERSsubscript To add up all the values in a two-dimensional array it would be best to use - ANSWERSnested loops The advantage of a linear search is that ___________. - ANSWERSit is simple and it can be used on unordered data A(n) ___________ search is more efficient than a(n) __________ search. - ANSWERSbinary, linear A binary search begins with the ___________ element of an array. - ANSWERSmiddle When searching for an item in an unordered set of data, binary search can find the item more quickly than linear search. - ANSWERSFalse Which of the sorts discussed so far made the same amount of passes and swaps no matter what order the numbers were in to start with? - ANSWERSSelection What is the minimum amount of passes that bubble sort will ever make? - ANSWERSOne With pointer variables you can access, but you cannot modify, data in other variables. -

Vista previa del contenido

Programming II Final Exam Questions
With Complete SolutionS!
A one-dimensional array can be initialized at the time it is defined, but a two-
dimensional array cannot be initialized at the time it is defined. - ANSWERSFalse

A(n) _________________ array is like several arrays of the same type put together. -
ANSWERStwo dimensional

To pass an array to a function, in the actual call you pass the
______________________ of the array. - ANSWERSname

To access an array element, use the array name and the element's -
ANSWERSsubscript

To add up all the values in a two-dimensional array it would be best to use -
ANSWERSnested loops

The advantage of a linear search is that ___________. - ANSWERSit is simple and it
can be used on unordered data

A(n) ___________ search is more efficient than a(n) __________ search. -
ANSWERSbinary, linear

A binary search begins with the ___________ element of an array. - ANSWERSmiddle

When searching for an item in an unordered set of data, binary search can find the item
more quickly than linear search. - ANSWERSFalse

Which of the sorts discussed so far made the same amount of passes and swaps no
matter what order the numbers were in to start with? - ANSWERSSelection

What is the minimum amount of passes that bubble sort will ever make? -
ANSWERSOne

With pointer variables you can access, but you cannot modify, data in other variables. -
ANSWERSFalse

The statement int *ptr = new int; acquires memory to hold an integer and then -
ANSWERSsets ptr to point to the allocated memory

The command to free up the memory that a pointer points to is the
_________________ command. - ANSWERSdelete

, Arithmetic operations can be performed on pointers? - ANSWERSTrue

________________ can be used as pointers - ANSWERSArray names

A pointer may be initialized with - ANSWERSthe address of an existing object of the
appropriate type

The statement double *num; - ANSWERSdefines a pointer variable called num

When the less than ( < ) operator is used between two pointer variables, the expression
is testing whether - ANSWERSthe address of the first variable comes before the
address of the second variable in the computer's memory

Assuming that arr is an array identifier, the statement sum += *arr; - ANSWERSadds
the value stored in arr[0]to sum

Which of the following statements is not valid C++ code (assuming num1 and ptr2 are
pointers)? - ANSWERSAll are invalid

The statement cout << &num1; will output - ANSWERSthe memory address of the
variable called num1

The statement cout << *ptr; will output - ANSWERSthe value stored in the variable
whose address is contained in ptr

The _________ and _________ operators can respectively be used to increment and
decrement a pointer variable. - ANSWERS++, --

____________ is required after the closing brace of a class declaration. -
ANSWERSsemicolon

Objects are created from abstract data types that encapsulate data and ____________
together. - ANSWERSfunctions

The ____________ is used to protect important data. - ANSWERSprivate access
specifier

A constructor - ANSWERSmust be public

When the body of a member function is defined inside a class declaration, it is called
a(an) ____________ function. - ANSWERSinline

A __________ is a member function that is automatically called when a class object is
__________. - ANSWERSconstructor, created

Información del documento

Subido en
6 de enero de 2025
Número de páginas
9
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$15.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

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.
papersmaster01
3.9
(73)
Vendido
302
Seguidores
106
Artículos
14701
Última venta
5 días hace


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