< previous page page_a75 next page >

Page A75
2. a. *p = @;

   b. *q = 959263;

   c. r->length = 12;       (*r).length = 12;
      r->width =14;   or    (*r) .width = 14;
      r->height = 5;        (*r).height = 5;

6. if (*p << *q)
       smaller = *p;
   else
       smaller = *q;
   delete p;
   delete q;

10. AddAndIncr(m, &n, &theirSum);
Chapter 17
Case Study Follow-Up
4. Change the function headings for ValueAt and Store so that the data types match those in the function prototypes. The bodies of ValueAt, Store, and the destructor do not need to be changed. Change the bodies of the constructor, copy-constructor, and CopyFrom functions by replacing
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
arr = new int[size];
with
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
arr = new float[size];
Chapter 18
Exam Preparation Exercises
2. True
5. Dynamic data structures can expand and contract during program execution.
8. a. array b. array c. dynamic linked list
Chapter 18
Programming Warm-Up Exercises
1. Function specification (within the OrdList class declaration):
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
int Length() const;
    // Postcondition:
    //     Function value == number of components in list
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Function definition:

 
< previous page page_a75 next page >