10B_W10_key1

10B_W10_key1 - PIC 10B EXAM 1 February 1, 2010 KEY Check...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: PIC 10B EXAM 1 February 1, 2010 KEY Check your TA's name: Rachel (10:00)____ Josh (11:00)____ David (12:00)___ You have 50 minutes to complete this exam. No books, notes, or calculators are allowed. Show all work. Incomplete, illegible, or unintelligible answers may receive no credit. There are a total of 50 points on this exam. The declaration of the Matrix class used in HW3 is provided for reference. PAGE POSSIBLE POINTS SCORE 1 10 2 6 3 12 4 12 5 10 TOTAL 50 1 4.) [8 points] Suppose we are creating a class Yoda that uses dynamic memory, so we should equip the class with the Big 4 functions. Write the single line declaration for each function in the Big 4, as it would appear in the Yoda class declaration. The Yoda class does not use any templates. i.) Yoda(); ii.) ~Yoda(); iii.) Yoda (const Yoda& right); iv.) Yoda& operator= (const Yoda& right); 2.) [2 points] What is the difference between the delete and delete commands? The delete command deallocates the one block that the pointer points to. The delete[ ] command is used for dynamic arrays to deallocate all blocks in the sequence. 2 3.) [2 points] For the IntMatrix class you created in HW2, the function operator<< function could not be written as a member function. Explain why....
View Full Document

This note was uploaded on 10/23/2011 for the course PIC 10B taught by Professor Wittman during the Winter '08 term at UCLA.

Page1 / 7

10B_W10_key1 - PIC 10B EXAM 1 February 1, 2010 KEY Check...

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

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