Practice Problems 6

Math 10 -- D. C. Smolarski, S.J.
Santa Clara University, Department of Mathematics and Computer Science

[Return to Math 10 Homepage]

Practice Problems 6

  1. What is the meaning of "overloading" a function?
  2. What is a benefit of using dynamically allocated arrays in a program rather than declaring them statically?
  3. Re-write the following assignment statement using the "pointer" notation for arrays rather than the "bracket" (subscript) notation:
       a)   a[i+1] = b;
       b)   c = a[0] + a[i];
    
  4. What is the delete operator do (e.g., when it is used with an array dynamically allocated)?
  5. What is a "template" and why would one want to use one?
  6. What is "assembly language"?
  7. Translate the following "assembler" code into a simple C++ assigment statement:
           LOAD    A
           ADD     B
           MULT    C
           STOR    D
    
  8. Translate the following C++ assignment statement into code for a "stack machine."
           d = a + b * c;
    
  9. Rewrite the code for the stack function push based on an underlying data structure of an array so that the underlying data structure is now a linked list.

For answers, try this link.


This page is maintained by Dennis C. Smolarski, S.J. dsmolarski@math.scu.edu
© Copyright 1998 Dennis C. Smolarski, SJ, All rights reserved.
Last changed: 5 December 1998.