Midterm 1 Postmortem

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

[Return to Math 10 Homepage]

NOTES:

Prob 1:

Several people forgot about the necessity to use the * to indicate multiplication, and others did not correctly translate b2 as b*b. (Some tried using ^ for exponentiation or pwr. There is a library function pow(x,y), but ^ is the symbol for the "exclusive or" operator.)

Prob 2:

Since there are 3 "cout" statements but only two "endl" commands, there should be only 2 output lines.

In the "cout" statements, a total of 7 variables are listed. Thus there should only be 7 values printed out.

A few people seemed to ignore the action of the cin.ignore statement.

Prob 3:

Several people did not notice that temp was NOT enclosed in quotes and thus its value should be printed out. The first (outer) loop is done twice (for i values of 2 and 3) and the second (inner) loop is done three times (for j values of -2, -1, and 0). Thus, the inner assignment statement is done 6 times giving 6 outputs via the if statement. No matter whether the if is true of false, some sort of output is produced.

Prob 4:

There are 5 "cout" statements. Some people ignored one or more of them. or mixed up the order in which they are executed.

They are NOT done (necessarily) in the order in which they appear, but rather in the order in which they are invoked, STARTING WITH THE FIRST LINE of the main program!

A number of people seem uncertain about what a variable parameter does or does not do.

Prob 5: In part a), several people indicated either an if or a switch, neither of which is a LOOP.

In part b), there seems to be widespread confusion about the difference between value and void functions and when they can be invoked. Both can be invoked anywhere in the main or in any other function! Both can change their own parameters (via variable [address] parameter). A value function returns one unique value and must be used as an expression, however (as with the library functions, sqrt, sin), whereas a void function returns no value AS AN EXPRESSION.
ALSO, "value" functions are not intrisically connected to "value" parameters. Some people described the difference between "value" and "variable" parameters which can be used with either kind of function!

Prob 6:

The modulus operator % must have integer arguments.

Also, one must use a double equals, ==, in a boolean expression to test for equality.

I specifically asked that the number value be printed out. But some people put quotes around "number" which doesn't print out the value.

Prob 7:

There are two "cout" statements, one before the double loop and one after the double loop. Since there is no "cout" statement within the loops, there should only be 2 output values.
At the end of the first time through the inner loops, a has the value of 23, thus the entire inner for loop is done one more time (giving a the value of 33) before it reaches the test of the do ... while loop.

Prob 8:

no comments.

Statistics

Distribution

                        x   x
                    x   x   x
                    x   x   x
                    x   x   x
                x   x   x   x
                x   x   x   x   x
    x           x   x   x   x   x

   30  40  50  60  70  80  90 100

Number of Perfect Scores per Problem

  1. 15/26
  2. 15
  3. 16 ("Easiest")
  4. 5 ("Hardest")
  5. 11
  6. 11
  7. 9
  8. 16 ("Easiest")

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