                          Computer Science 101
                               Quiz 9      Name ______________________

1.  Which of the following is a correct function prototype:

     a. int sum(a, b)                   b. int sum(int a, int b){};

     c. int sum(int a, int)             d. int sum(int a, int b);

2.  If I have a collection of prototypes for functions that I
    have written in a file named myhdrs.h in the current working
    directory the proper way to include it is:

    a. #include "myhdrs.h"              b. #include myhdrs.h

    c. #include <myhdrs.h>              d. #include {myhdrs.h}


3. A color ppm image having dimension 200 rows by 300 columns contains
   how much image data:

   a. 500 bytes                           b. 60000 bytes

   c. 180000 bytes                        d. 1500 bytes


4. The proper way to write a red pixel into a ppm file is:

   a. fprintf(stdout, "%c %c %c",   255, 0, 0);

   b. fprintf(stdout, "%c%c%c",     255, 0, 0);

   c. fprintf(stdout, "%c%c%c\n",   255, 0, 0);

   d. fprintf(stdout, "%c %c %c\n", 255, 0, 0);


5. The following is a correct ppm header in hexadecimal.

    50 36 0a 32 30 30 20 31 35 30 20 32 35 35 0a

    Suppose I build a solid color bright red image but
    When building the header if I accidentally add an extra space
    character to the header creating this:

    50 36 0a 32 30 30 20 31 35 30 20 32 35 35 0a 20 ff 00 00 ff 00 00 ..


    a. it will have no adverse effect   b. The image will appear
       when I view the image               green instead of red

    c. the image will appear blue       d. The image will appear
       instead of red                      purple instead of red
