CPA Chapter 5 Assessment Answers 100%

CPA Chapter 5 Assessment Answers 100% What happens when you attempt to compile and run the following code? #include <iostream> #include <string> using namespace std; class A { public: string a(string b) { return b.substr(0,2); }}; class B { public: string a(string b) { return b.substr(2,2); }}; int main() { A a; B b; cout […]
Continue reading…

 

CPA Chapter 4 Assessment Answers 100%

CPA Chapter 4 Assessment Answers 100% What happens when you attempt to compile and run the following code? #include <iostream> using namespace std; int main() { char   t[3][3], *p = (char *)t; for(int i = 0; i < 9; i++) *p++ = ‘a’ + i; cout << t[1][1]; return 0; } It prints g It […]
Continue reading…

 

CPA Chapter 1 Assessment Answers 100%

CPA Chapter 1 Assessment Answers 100% Which of the following strings is a proper integer number (in the “C++” language sense)? 3.14 3E14 3,14 314 What is the value of the following literal? 010 8 10 The literal is invalid. 2 What is the value of the following literal? X10 The literal is invalid. 10 […]
Continue reading…