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

CPP Advanced Programming in C++ Cisco Chapter 2 Assessment

Puntuación
-
Vendido
-
Páginas
29
Grado
A+
Subido en
02-09-2022
Escrito en
2021/2022

CPP Advanced Programming in C++ Cisco Chapter 2 Assessment

Institución
Grado

Vista previa del contenido

[CPP] Chapter 2 Assessment
 Due No due date




 Points 28




 Questions 28




 Time Limit 40 Minutes




 Allowed Attempts 2


Instructions
Welcome to chapter 2 assessment
This test will help you evaluate what you have learned in chapter 2. You will have 40 minutes to
answer 28 questions. You will not be able to see the correct answers. If you are not satisfied with
your result, you can re-take the test once. Good luck!

Attempt History
Attempt Time Score

KEPT Attempt 2 14 minutes 25 out of 28

, Attempt Time Score

LATEST Attempt 2 14 minutes 25 out of 28

Attempt 1 34 minutes 23.5 out of 28
Correct answers are hidden.
Score for this attempt: 25 out of 28
Submitted Dec 22 at 1:11pm
This attempt took 14 minutes.

Question 1
pts
What happens when you attempt to compile and run the following code? Choose all that apply.

#include <iostream>
#include <set>
#include <vector>
#include <functional>
using namespace std;

int main(){
int mynumbers[] = { 3, 9, 0, 2, 1, 4, 5 };
vector<int> v(mynumbers, mynumbers+7);
set<int> set1(v.begin(),v.end());
set<int, greater<int> > set2(v.begin(), v.end()); //LINE I
for(set<int, int>::iterator i=set2.begin();i!= set2.end(); i++)
cout<<*i<<" ";
for(set<int>::iterator i=set1.begin();i!= set1.end(); i++)
cout<<*i<<", ";
cout<<endl;
return 0;
}




program outputs: 9 5 4 3 2 1 0 0, 1, 2, 3, 4, 5, 9,



program outputs: 0 0 1 2 3 4 5 9, 1, 2, 3, 4, 5, 9,



compilation fails due to error in line I



code compiles and executes successfully

, program outputs: 9 5 4 3 2 1 0, 1, 2, 3, 4, 5, 9,



IncorrectQuestion 2
pts
What happens when you attempt to compile and run the following code? Choose all that apply.

#include <iostream>
#include <set>
#include <vector>
using namespace std;
int main(){
int mynumbers[] = { 3, 9, 0, 2, 1, 4, 5 };
vector<int> v(mynumbers, mynumbers+7);
set<int> s1(v.begin(),v.end());
s1.insert(v.begin(),v.end());
s1.insert(10);
s1.erase(s1.lower_bound(4),s1.upper_bound(6));
s1.insert(v.begin(),v.end());
for(set<int>::iterator i=s1.begin();i!= s1.end(); i++)
cout<<*i<<", ";
return 0;
}




the size of the s1 set is 7



program outputs: 0, 1, 2, 3, 4, 5, 9,



program outputs: 0, 1, 2, 3, 4, 5, 9, 10,



the size of the s1 set is 8



program outputs: 0, 1, 2, 3, 4, 5, 10,

Escuela, estudio y materia

Grado

Información del documento

Subido en
2 de septiembre de 2022
Número de páginas
29
Escrito en
2021/2022
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$5.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
arviemontemayor

Documento también disponible en un lote

Conoce al vendedor

Seller avatar
arviemontemayor AMACC
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
-
Miembro desde
3 año
Número de seguidores
0
Documentos
39
Última venta
-

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Documentos populares

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