0% found this document useful (0 votes)
44 views7 pages

Advanced Programming in C++ CPP ASSESSMENT Chapter 1 Assessment (Score For This Attempt: 22.17 Out of 30)

This document contains summaries of multiple chapters of assessments on C++ programming concepts. It provides the scores achieved on various quizzes and assessments covering topics like vectors, sets, maps, algorithms, inheritance, templates, and more. For each chapter, it lists the questions asked and possible outputs or errors for the programs assessed.

Uploaded by

google account
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views7 pages

Advanced Programming in C++ CPP ASSESSMENT Chapter 1 Assessment (Score For This Attempt: 22.17 Out of 30)

This document contains summaries of multiple chapters of assessments on C++ programming concepts. It provides the scores achieved on various quizzes and assessments covering topics like vectors, sets, maps, algorithms, inheritance, templates, and more. For each chapter, it lists the questions asked and possible outputs or errors for the programs assessed.

Uploaded by

google account
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

advanced programming in C++ CPP ASSESSMENT

chapter 1 assessment (Score for this attempt: 22.17 out of 30)

1 - code compiles and executes successfully


2 - program will not compile
3 - value returned by size() is the same for vectors v1 and v2
- code will not compile
4 - program will run and print output: Exception!
5 - program will run successfully and display: 1 2 3 4 5 6 7 8 9 10
6 - program will run successfully and display: 1 2 3 5 6 7 8 9 10 9
7 - size()
8 - program will run successfully and display: 10 10 10 10 10 10 10 10 10 10 : 10
9 - code will not compile
10 - code will not compile
11 - code will not compile due to error in line LINE I
- code will not compile due to error in line LINE II
12 - code will not compile due to error in line LINE I
- code will not compile due to error in line LINE II
13 - clear()
14 - none of these
15 - code will not compile
16 - when program reaches LINE I there will be 10 objects of type A
17 - vector
18 - deque<int> d; priority_queue<int> q(d);
19 - program will display: 5 5
20 - list, deque, vector
21 - deque<int> d; queue<int> q(d);
22 - program will display: 1 2 5 2
23 - deque , vector, list
24 - program will display: 2 2
25 - code will not compile due to error in line LINE II
26 - program will run successfully and display: 1 2 3 5 6 7 8 9 10 9
27 - clear ()
28 - code will not compile
29 - code will not compile due to error in line marked LINE II
30 - none of these

chapter 2 assessment (Score for this attempt: 26 out of 28)


1 - program outputs: 9 5 4 3 2 1 0 0, 1, 2, 3, 4, 5, 9,
2 - program outputs: 0, 1, 2, 3, 4, 5, 9, 10,
- the size of the s1 set is 8
3 - compilation fails because there is no bool operator < defined in class A
4 - program outputs: 0, 1, 2, 3, 4, 5, 9,
5 - program outputs: 9,
6 - compilation error in LINE II
- compilation error in LINE I
7 - The output will be: 5, 8
8 - The output will be: 0, 1, 2, 3, 4, 5, 9, 9, 9, 5, 4, 3, 2, 1, 0,
9 - The output will be: 0, 0, 5, 5, 9, 9,
10 - The output will be: 9, 9, 1, 1, 0, 0,
11 - program outputs: 0, 1, 2, 3, 4, 9,
12 - program outputs: 0, 1, 2, 3, 4, 5, 6, 9,
13 - compilation error in LINE I
14 - program outputs: 5, 5, 5,
15 - compilation error in LINE I
16 - the exception will be thrown at line LINE I
17 - program outputs: zero, one, two, three, four, five, nine, , 8
18 - code compiles and executes successfully with the expected result
19 - program outputs: 0, 1, 2, 3, 4, 5, 9,
20 - compilation error in LINE I
21 - program outputs: 3,
22 - program outputs: 0, 1, 2, 3, 4, 5, 9,
23 - compilation error in LINE I
24 - program outputs: found expected zero, one, two, three, four, five, nine, 7
25 - bool operator < (const A & b) const { return a<b.a;} inserted at LINE I
26 - program outputs: 0, 1, 2, 3, 4, 5, 5, 9,
27 - compilation error in LINE I
28 - 4,

chapter 3 assessment (Quiz Score: 25.5 out of 28)

1 - program outputs: 3, 9, 0, 2, 1, 4, 5, 0, 1, 2, 3, 4, 5, 9, 9, 0, 2, 1, 4, 5,
2 - compilation error in LINE IV
3 - program outputs: 3, 9, 0, 2, 1, 4, 5, 0, 1, 2, 3, 4, 5, 9,
4 - compilation error in LINE IV
- compilation error in LINE III
5 - it will compile and print 6
6 - it will display: Found!
7 - it will not compile successfully
- compilation error in LINE II
8 - program outputs: Found at position: 1
9 - compilation error in LINE III
10 - program outputs: First found at position: 1
11 - program outputs: 1, 2, 3,
12 - program will run forever
13 - program outputs: 3, 4,
14 - Program outputs: 2
15 - compilation error in LINE I
16 - the exception will be thrown at LINE I
17 - program outputs: 6
18 - program outputs: 4
19 - program outputs: 0, 3
20 - program outputs: Not identical
21 - compilation error in LINE I
22 - program outputs: 1
23 - program outputs: found at position: 1
24 - program outputs: First found at position: 7
25 - program outputs: 12
26 - program outputs: 12
27 - program outputs: 4
28 - size of map m is 6
- program outputs: 0, 1, 2, 3, 4, 5, 6,

chapter 4 assessment (Quiz Score:24.5 out of 27)

1 - program outputs: 3, 9, 0, 2, 1, 4, 5,
2 - program outputs: 5, 4, 1, 2, 0, 9, 3,
3 - compilation error in LINE I
4 - program outputs: 0, 1, 2, 3, 4, 5, 9, 3, 9, 0, 2, 1, 4, 5,
5 - compilation error in LINE I
- compilation error in LINE II
6 - program outputs: 5, 9, 0, 2, 1, 4, 5,
7 - program outputs: 0, 1, 2, 3, 4, 5, 9,
8 - program outputs: 0, 2, 4, 6, 8, 10, 18,
9 - runtime error at LINE I or undefined (probably empty) output
10 - program outputs: 3, 3, 0, 2, 1, 4, 5,
- you can't call the replace function on the s1 set
11 - you can't call the replace function with the classifier function as the third parameter
- pro gram outputs: 3, 7, 0, 2, 1, 7, 7,
12 - compilation error in LINE I
13 - program outputs: 1, 1, 1, 8, 7, 7, 1,
14 - program outputs: 1, 1, 1, 8, 7, 7, 7,
15 - program outputs: 1, 1, 1, 1, 1, 1, 1,
16 - program outputs: 1, 2, 3, 4, 5, 6, 7,
17 - compilation error in LINE II
18 - program outputs: 1, 3, 5, 7, 5, 6, 7,
- you can't call the remove_if function on set
19 - compilation error in LINE I
- you can't call the remove_if function on set
20 - program outputs: 0, 3, 0, 3, 0, 3, 0,
21 - program outputs: 3, 0, 0, 0, 3, 3, 0, 0,
22 - you can't call the reverse function on the d1 deque
- you can't call the reverse function on the s1 set
- program outputs: 3, 4, 5, 5, 4, 3, 3, 4, 5,
23 - program outputs: 3, 4, 5, 6,
24 - program outputs: 5, 4, 3, 6,
25 - program outputs: 6, 5, 4, 3,
26 - program outputs: 6, 5, 4, 3,
27 - program outputs: 6, 5, 4, 3,

chapter 5 assessment

1 - program outputs: 9, 5, 4, 3, 2, 1, 0,
2 - program outputs: 0, 2, 3, 4, 5, 5, 9,
- the size of the v1 vector is 7
3 - program outputs: 0.22, 1.14, 3.33, 4.45, 5.55, 9.19, 9.19,
- the size of the v1 vector is 7
4 - program outputs: 4, 5, 6, 9,
5 - program outputs: 4, 5, 9, 6,
 *6 - program outputs: 3,
7 - program outputs: 3, 3,
8 - program outputs: 1, 0,
*9 - runtime error at LINE I
10 - program outputs: 0, 1, 2, 3, 4, 5, 9,
11 - program outputs: 0.22, 1.14, 2.12, 3.33, 4.45, 5.55, 9.19,
12 - program outputs: 4, 5, 6, 9,
13 - program outputs: 4, 5, 9
14 - program outputs: 4,
15 - program outputs: 3, 3,
16 - program outputs: 1, 1,
*17 - runtime error at LINE II
*18 - runtime error at LINE II
19 - program outputs: 0, 1, 2, 3, 4, 5, 9,
20 - program outputs: yyY, Yyy, yyy, yYy, zzz, zzZ, Zzz, zZz,
21 - program outputs: 3, 2, 1, 0
22 - program outputs: 0, 1, 2, 3, 4, 5, 9,
23 - program outputs: 3, 3,
24 - program outputs: 1, 1,

chapter 6 assessment (Quiz Score: 29.17 out of 30)

1 - program outputs: 0, 1, 2, 3, 4, 5, 9,
2 - program outputs: 0, 1, 2, 3, 4, 5, 0,
3 - compilation error in LINE II
4 - program outputs: 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 9,
5 - program outputs: 0, 0, 0, 1, 2, 3, 4, 6, 7, 9,
6 - program outputs: 0, 0,
7 - program outputs: 0, 1, 2, 3, 4, 5, 0,
8 - program outputs: 0, 1, 2, 3, 4, 5, 0,
9 - program outputs: 2, 0, 0, 0, 0, 0,
10 - program outputs: 0, 0, 0, 0, 0, 0, 0,
11 - program outputs: 0, 2, 3, 9, 0, 0, 0,
12 - program outputs: 0, 3, 9, 0, 0, 0, 0,
13 - program outputs: 0, 1, 3, 4, 9,
14 - program outputs: 0,
15 - program outputs: 0,
16 - program outputs: 9,
17 - program outputs: 0, 1, 2, 4,
(.0.67 points) *18 - you shouldn't call the inplace_merge function on the non-ordered v1
vector
- program outputs: 0, 1, 3, 4, 5, 6, 9,
19 - program outputs: 0, 2, 3,
20 - program outputs: 1, 1
21 - program outputs: 1, 1
22 - program outputs: 0, 1, 2, 3, 4, 5, 0
23 - program outputs: 2, 0, 0, 0, 0, 0, 0,
24 - program outputs: 0, 3, 0, 0, 0, 0, 0,
25 - program outputs: 0, 1, 3, 4, 0, 0, 0,
*(0.5 points) 26 - program outputs: 0,
27 - compilation error in LINE II
28 - program outputs: Yyy, ZZZ, ZZz, ZzZ, yYy, yyY, zZZ, , - last element could be empty or
zZZ or yyy
29 - program outputs: 1, 0
30 - program outputs: 1, fno,

chapter 7 assessment (Quiz Score: 18 out of 20)

1 - program outputs: 9, 10, 4, 7,


2 - program outputs: 5, 4, 1, 2, 0, 9, 3,
3 - program outputs: 7, 5, 4, 1, 2, 0, 9, 3,
4 - program outputs: 3, 5, 4, 1, 2, 0, 9, 3,
5 - program outputs: 2, -5, 1, 0, -1, 5, -2,
6 - program outputs: 4, 3, 0, 1, -1, 8, 2,
7 - compilation error in LINE I
8 compilation error in LINE I
 9 - program outputs: 8, 20, 2, 6, 4, 10, 12,
10 - compilation error in LINE II
*11 - program outputs: 0
12 - program outputs: 6
13 - program outputs: 5, 10, 4, 7, 0
14 - program outputs: 6, 5, 2, 3, 1, 10, 4,
15 - program outputs: 5, 4, 1, 2, 0, 9, 3,
16 - program outputs: 5, 4, 1, 2, 0, 9, 3,
17 - program outputs: 3, 2, 1, 1, 0, 1, 0,
18 - program outputs: 6, 5, 2, 3, 1, 10, 4,
19 - program outputs: 5, 4, 1, 2, 0, 9, 3,
20 - compilation error in LINE II

chapter 8 quiz/assessment (Quiz Score: 19 out of 26)

1 - program outputs: 127, 127, 127, (but it is an unpredictable result)


2 - program outputs: 127, 127, 127, (but it is an unpredictable result)
3 - program outputs: 127, 7f, 0x7f
4 - program outputs: 127, 0x7f, 7f
5 - program outputs: 127, 0177, 177
6 - program outputs: 127.45, 127.45, 127.45,
7 - compilation error in LINE II
8 - program outputs: 127, 0x7f, 0x7f,
9 - program outputs: 0, , true,
10 - program outputs: 3.1415, 3.2, 3.14150, 3.20000,
11 - program outputs: 3.1415, 3.2, 3.14, 3.2,
12 - compilation error in LINE I
13 - program outputs: 3.1415, 3.200000, 3.142, 3.2,
14 - program outputs: 3.1415, 3.142e+00, 3.2,
15 - program outputs: 7, 9, 8,
16 - program outputs: 9, 9
17 - ogram outputs: 9 8 a, 9 8 a,
18 - compilation error in LINE I
19 - program outputs: 7.7, 9.9, 8.8,
20 - program outputs: true, true, false (but the c3 value is undefined)
21 - ogram outputs: r, e, w, qw, q,
22 - program outputs: 7, 8,9
23 program outputs: 597, 295, 295,
*24 - compilation error in LINE II
25  program runs forever without output
 
26 - program outputs: 3, 9, 0, 2, 1, 4, 5,

chapter 9 quiz/assessment (Quiz Score: 20 out of 22)


1 - program outputs: 2
2 - program outputs: 2
3 - program outputs: 3.5
4 - compilation error in LINE II
5 – 2.5
*6 - compilation error in LINE I
7 - program outputs: 7
8 - compilation error in LINE I
9 - program outputs: 7
10 - compilation error, the reason is in LINE I
11 - program outputs: 7
12 - program outputs: 10, 13
13 - compilation error, the reason is in LINE II
14 - program outputs: 7, 10
15 - ogram will display: Hello world!
16 - compilation error in LINE II
17 - program outputs: HiMaker, HiMaker
18 - compilation error in LINE I
19 - program outputs: HiTech, HiTech
20 - compilation error in LINE I
21 - program outputs: 7, 9
22 - with the typename keyword
- with the class keyword

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy