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 4 fuera de 33 páginas
Examen

CSCI 121 FINAL EXAM 2025 WITH 100% ACCURATE SOLUTIONS

Document preview thumbnail
Vista previa 4 fuera de 33 páginas

CSCI 121 FINAL EXAM 2025 WITH 100% ACCURATE SOLUTIONS

Vista previa del contenido

CSCI 121 FINAL EXAM 2025 WITH 100%
ACCURATE SOLUTIONS


When you have a function that expects an array, it should also
expect the size of the array or the number of indexed variables
with valid data. (T/F) - Answer True


How many indexed variables does the following array have? int
myArray[12]={1,2,3,6,5,4,7,1,2}; - Answer 12


In the expression
cout << score[i]<< endl;
i is called the ________. - Answer index


The computer remembers the address of which indexed
variable(s) in an array? - Answer 0


What is wrong with the following code?
float total[8], scores[10];
a.) The 10 should be replaced with a variable name, whose value
is input from the user.

,b.) Cannot declare two array variables with different size
together.
c.) Cannot declare two array variables together
d.) nothing - Answer D


What is wrong with the following code fragment?
const int SIZE=5;
float scores[SIZE];
for( int i=0; i<=SIZE; i++){
cout<<"Enter a score";
cin>>scores[i];
}
a.) Array indexes start at 1 not 0.
b.) Arrays must be integers.
c.) Array indexes must be less than the size of the array.
d.) Should be cin >> scores[0]; - Answer C


Which of the following function declarations could be used to
input data from the keyboard into the array?
a.) void input(int array[], int &numElements, int MAX_SIZE);
b.) void input(int array[], int numElements, int MAX_SIZE);
c.) void input(int &array[], int numElements, int MAX_SIZE);

,d.) int array[] input(int array[], int &numElements, int
MAX_SIZE); - Answer A


Which of the following will correctly assign all the values in one
array to the other array? (Assume both arrays are of the same
type and have SIZE elements.)
a.) array1=array2;
b.) array1[]=array2;
c.) for(i=0;i<SIZE;i++)
array1[i]=array2[i];
d.) for(i=0;i<SIZE;i++)
array1[]=array2[]; - Answer C


The following code declares a vector of characters.vector
characters<char>
(T/F) - Answer False


Vector assignment is well behaved. (T/F) - Answer True


A string variable and a c-string are the same data type. (T/F) -
Answer False

, The function used to "put two c-strings together into one" is
called ________. - Answer strcat


A character array terminated with the null character is most
correctly called______.
a.) a c-string.
b.) a character array.
c.) a string.
d.) None of these. - Answer A


What is the value of numbers.size() after the following code?
vector<float>numbers;
numbers.reserve(100); - Answer 0


When the extraction operator is used to read data into a string
a.) it skips all white spaces.
b.) it skips only new lines.
c.) it reads everything on the line.
d.) it reads as many characters that will fit into the c-string. -
Answer A

Información del documento

Subido en
3 de diciembre de 2024
Número de páginas
33
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$16.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.
YANCHY
4.1
(449)
Vendido
1786
Seguidores
1159
Artículos
23426
Última venta
1 semana 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