Assignment: #assessment4 Points: 3 Due: 05/06/2017
a)  Evaluate:  true || (false && true) && false || !false

b)  Evaluate:  5 / 2 * 3.14

c)  Rewrite the following code snippet without using a goto.

    int sleepy = 10; bed: sleepy--; if (sleepy) goto bed;

d)  Briefly explain what is variable and how a variable is defined in C++.

e)  Who created the C++ programming language?

f)  Record what the following code snippet will print...

    const int LEN = 5; int a[LEN] = { -1, 1 };
    for (int i = 0; i < LEN && a[i]; i++) 
       cout << a[i] << ", ";

g)  Record what the following code snippet will print...

    bool flag = true;
    do { cout << "hello, world"; } while (!flag);

h)  Rewrite the following code snippet replacing the 'for' with 'while'...
   
    int i; for (i = 100; i; i -= 10) cout << i << endl;

i)  Record what the following code snippet will print...

   double answer = power(base, exponent);
   cout << answer << endl;

   double power(double b, int n) {
      if (p == 0) return 1;
      return b * power(b, p-1);
   }