quiz3_s001_sol

quiz3_s001_sol - appropriate test coverage? s. Keyboard...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 012 – Intro to Computer Science II Spring - 2005 Quiz 3 Section 001 – Friday 4/15 SOLUTION Each question is worth 1 point. 1. Connecting the application and implementation files together to form an executable file is called a. compiling b. assembling c. linking d. debugging 2. All the code between #ifndef MYCLASS_H and #endif is ____________ if MYCLASS_H is defined. e. skipped f. executed g. compiled h. debugged 3. If x is negative, the following statement assert(x >= 0); i. terminates the program, displays the file name, line number, and expression. j. does nothing. k. outputs a warning and continues executing the program. l. outputs a warning, sets x equal to 0 and continues executing the program. m. returns the value false. 4. “Regression” testing refers to n. Never throwing away a test o. Never throwing a version of your code p. Testing your code one function or class at a time q. Using a test harness r. A psychological analysis of your code 5. A “test harness” is used to perform unit tests. Which of the following can provide
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: appropriate test coverage? s. Keyboard input t. File input u. Randomly generated values v. All of the above 6. A pointer variable can contain: w. The address of a valid object or variable x. The value NULL y. The address of a deleted object z. A random address value aa. All of the above bb. A, B or D 7. Which of the following assigns the address of value to the pointer p1? cc. *p1 = &value; dd. p1 = value; ee. p1 = &value; ff. &p1 = *value; 8. What is the output of the following code fragment? int v1=2, v2=-1, *p1, *p2; p1 = & v1; p2= & v2; p2=p1; cout << *p2 << endl; gg. 2 hh. -1 ii. -2 jj. 1 9. Given that p1 is a pointer to a string, which of the following are legal statements? kk. p1 = new int; ll. cout << *p1; mm. p1 = new char[10]; nn. *p1 = new string; oo. all of the above pp. B and D 10. What is the output of the following code? int *p1, *p2; p1 = new int; p2 = new int; *p1 = 11; *p2 = 0; p2 = p1; cout << *p1 <<" " << *p2 << endl; qq. 11 0 rr. 0 11 ss. 11 11 tt. 0 0...
View Full Document

Page1 / 2

quiz3_s001_sol - appropriate test coverage? s. Keyboard...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online