• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 10 páginas
Examen

Cs 102 Review Exam Practice Study Test.

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

CS 102 REVIEW EXAM PRACTICE STUDY TEST. Given the following code: int main() { int a; cin a; if (a = 7) { cout "yes"; } else { cout "no"; } } What would be printed to the screen ... If the user typed 0? if the user typed 100? - CORRECT ANSWER yes; yes int main() { int i; for (i = 0;i 10;i++);;; cout 'A'; cout i; } How many times is A printed to the screen? What is the value of i printed to the screen? - CORRECT ANSWER 1 time because there are no brackets; 10 Declare a vector of 1000 strings, each with the initial value "Hello", in one statement. - CORRECT ANSWER vectorstring v(1000,"Hello"); Given the following code: int main() { string line; ........ while (????) { cout "Got a line: " line 'n'; } } Given that fin is an open file stream, write the code for ???? that will get a single line from fin and store that line into the variable "string line". - CORRECT ANSWER getline(fin, line)

Vista previa del contenido

CS 102 REVIEW EXAM PRACTICE
STUDY TEST.
Given the following code:



int main()

{

int a;

cin >> a;

if (a = 7) {

cout << "yes";

}

else {

cout << "no";

}

}




What would be printed to the screen ...



If the user typed 0?



if the user typed 100? - CORRECT ANSWER yes; yes



int main()

{

int i;

for (i = 0;i < 10;i++);;;

, cout << 'A';

cout << i;

}

How many times is A printed to the screen?



What is the value of i printed to the screen? - CORRECT ANSWER 1 time because there are no brackets;
10



Declare a vector of 1000 strings, each with the initial value "Hello", in one statement. - CORRECT
ANSWER vector<string> v(1000,"Hello");



Given the following code:




int main()

{

string line;



........

while (????) {

cout << "Got a line: " << line << '\n';

}

}



Given that fin is an open file stream, write the code for ???? that will get a single line from fin and store
that line into the variable "string line". - CORRECT ANSWER getline(fin, line)



Given the following code:

Información del documento

Subido en
12 de diciembre de 2024
Número de páginas
10
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$12.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.
ROSEGRADES
3.4
(35)
Vendido
236
Seguidores
87
Artículos
12121
Última venta
1 mes 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