Programming Background Evaluation

Programming Background Evaluation

The purpose of this survey/evaluation is to help the instructor understand what you know.

Please provide information about yourself

Binary Logic

Integer Arithmetics

Iteration

Consider the following code segment.
   int x = 3;
   int i;
   for (i = 0; i < 5; i ++)
   {
      x = x + i;
   }

Control Flow

   int x = 3;
   int y = 5;
   int z = 7;
   int a = -1;
   if (x < y)
   {
      if (y > z)
      {
         a = 9;
      }
      else
      {
         a = 35;
      }
   } 
   else
   {
     a = 6;
   }

Recursion

 
    int f(int x)
    {
       if (x <= 0)
       {
          return 0;
       }
       else
       {
          return x + f(x - 1);
       }
    }

Fibonacci Number

   int f(int x)
   {
      if (x <= 1)
      {
         return 1;
      }
      else
      {
         return (f(x - 1)  + f(x - 2));
      }
   }

Variable Scope

   int x = 5;
   {
      int x = 7;
      x = x + 1;
   }

Series

Set Theory

Suppose A and B are two sets of integers. Every element in A is smaller than (but not equal to) every element in B. The value 7 is in A. This can be expressed as follows.

x in A, y in B => x < y.

7 in A.

Number Theory

Logic

If it is raining, Tom always brings an umbrella.

If Condition

Consider the following code segment. L1 and L2 represent the locations immediately before and after the code.
   int x;
   int y;
   ... /* some code */

L1
   if (x == 0)
   {
      y = 0;
    }
L2

Prerequisites