Last Updated on November 23, 2018 by Admin
CPA Chapter 7 Assessment Online 100%
CPA -- Chapter 7 Assessment
Time limit: 0
Quiz-summary
0 of 20 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
Information
CPA -- Chapter 7 Assessment
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 20 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- Answered
- Review
-
Question 1 of 20
1. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> using namespace std; int main() { try { throw 2/4; } catch(int i) { cout << i; } return 0; }Correct
Incorrect
-
Question 2 of 20
2. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> using namespace std; int main() { try { throw 2./4; } catch(int i) { cout << i; } return 0; }Correct
Incorrect
-
Question 3 of 20
3. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> using namespace std; int main() { throw 2/4; catch(int i) { cout << i; } return 0; }Correct
Incorrect
-
Question 4 of 20
4. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> using namespace std; int main() { try { throw exception(); } catch(exception &x) { cout << x.what(); } return 0; }Correct
Incorrect
-
Question 5 of 20
5. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> using namespace std; int main() { try { throw 3.14; } catch(double x) { x *= 2; } cout << x; return 0; }Correct
Incorrect
-
Question 6 of 20
6. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <string> using namespace std; class X { public: X(void) { cout << 1; } ~X(void) { cout << 2; } }; void exec() { { X x; } throw string("0"); } int main(void) { try { exec(); } catch(string &s) { cout << s; } return 0; }Correct
Incorrect
-
Question 7 of 20
7. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <string> #include <iostream> using namespace std; class X { public: X(void) { cout << 1; } ~X(void) { cout << 2; } }; X *exec() { X *x = new X(); throw string("0"); return x; } int main(void) { X *x; try { delete exec(); } catch(string &s) { cout << s; } return 0; }Correct
Incorrect
-
Question 8 of 20
8. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> using namespace std; class X { public: X(void) { cout << 0; } ~X(void) { cout << 2; } }; int main(void) { try { X *x = new X(); throw true; delete x; } catch(bool s) { cout << s; } return 0; }Correct
Incorrect
-
Question 9 of 20
9. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> using namespace std; class X { public: X(void) throw(int) { cout << 1; } ~X(void) throw(int) { cout << 2; } void exec() { throw 0; } }; void exec(X &x) { x.exec() ; } int main(void) { X x; try { exec(x); } catch(int &i) { cout << i; } return 0; }Correct
Incorrect
-
Question 10 of 20
10. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> using namespace std; class X { public: X(void) throw(int) { cout << 1; } ~X(void) throw(int) { cout << 2; } void exec() { throw string("0"); } }; void exec(X x) { x.exec() ; } int main(void) { X x; try { exec(x); } catch(int &i) { cout << i; } return 0; }Correct
Incorrect
-
Question 11 of 20
11. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> #include <stdexcept> using namespace std; class X : public logic_error { public: X() : logic_error("0") {}; }; void z() throw(X) { throw new logic_error("0"); } int main(void) { X x; try { z(); } catch(X &i) { cout << i.what(); } return 0; }Correct
Incorrect
-
Question 12 of 20
12. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> #include <stdexcept> using namespace std; class X : public logic_error { public: X() : logic_error("0") {}; }; void z() throw(logic_error) { X x; throw x; cout << 1; } int main(void) { X x; try { z(); } catch(logic_error &i) { cout << i.what(); } return 0; }Correct
Incorrect
-
Question 13 of 20
13. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> #include <stdexcept> using namespace std; class X : public domain_error { public: X() : domain_error("0") {}; }; void z() throw(X) { X x; throw x; cout << 1; } int main(void) { X x; try { z(); } catch(X &i) { cout << 1; } catch(domain_error &i) { cout << 0; } return 0; }Correct
Incorrect
-
Question 14 of 20
14. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> #include <stdexcept> using namespace std; class X : public runtime_error { public: X() : domain_error("0") {}; }; void z() throw(X) { X x; throw x; cout << 1; } int main(void) { X x; try { z(); } catch(X &i) { cout << 1; } catch(domain_error &i) { cout << 0; } return 0; }Correct
Incorrect
-
Question 15 of 20
15. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> #include <stdexcept> using namespace std; class E {}; class X { static int c; public: X() { if(c++ > 2) throw new E; } ~X() { if(c++ > 2) throw new E; } }; int X::c = 0; void f(int i) { X a,b; cout << i; } int main(void) { try { f(0); f(1); } catch(...) { cout << 1; } return 0; }Correct
Incorrect
-
Question 16 of 20
16. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> #include <stdexcept> using namespace std; class E {}; class X { public: static int c; X(int a) { c = a; } ~X() { if(c++ > 2) throw new E; } }; int X::c = 0; void f(int i) { X* t[2]; for(int j = 0; j < i; j++) t[j] = new X(i+1); for(int j = 0; j < i; j++) delete t[j]; } int main(void) { try { f(2); } catch(...) { cout << X::c; } return 0; }Correct
Incorrect
-
Question 17 of 20
17. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> #include <stdexcept> using namespace std; class E {}; void f(int i) { E e; switch(i) { case 0 : throw e; case 1 : throw &e; } cout << 0; } int main(void) { try { f(2); } catch(E*) { cout << 1; } catch(E) { cout << 2; } return 0; }Correct
Incorrect
-
Question 18 of 20
18. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> #include <stdexcept> using namespace std; class E {}; void f(int i) { E e; switch(i) { case 0 : throw e; case 1 : throw &e; } cout << 0; } int main(void) { try { f(1); } catch(void *) { cout << 2; } catch(E*) { cout << 1; } return 0; }Correct
Incorrect
-
Question 19 of 20
19. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> #include <stdexcept> using namespace std; class Int { public: int v; Int(int a) : v(a) {} }; void a() { throw Int(1); } void b() { try { a(); } catch(Int &i) { throw Int(i.v + 1); } } void c() { try { b(); } catch(...) { throw; } } int main(void) { try { c(); } catch(Int &i) { cout << i.v; } return 0; }Correct
Incorrect
-
Question 20 of 20
20. Question
1 pointsWhat happens when you attempt to compile and run the following code? #include <iostream> #include <exception> #include <stdexcept> using namespace std; class Int { public: int v; Int(int a) : v(a) {} }; void a() { throw 0; } void b() { try { a(); } catch(int i) { throw Int(i + 1); } } void c() { try { b(); } catch(...) { throw; } } int main(void) { try { c(); } catch(Int &i) { cout << i.v; } return 0; }Correct
Incorrect