Questions 2 - CPSC 220 Spring 2008
From MWCSWiki
The questions may be found at the Web page with the URL http://paprika.umw.edu/~ernie/cpsc220/Questions2.html
Again, an interesting set of answers.
- Everyone got the question about how many male Republicans were at the event.
- The question about the sum of the powers of 2, from 2**2 + 2**3 + .. + 2**9 + 2++10,may not have been too clear since several people got answers that were closer to 2+3+4+..+9+10. 2**2 + 2**3 + ... + 2**9 + 2**10 is a geometric series. Thus the sum is (2**2 -2**10*2)/ (1 -2) = 2044
- The question about how to find information about buying a house on the Internet has more than one interpretation. Some took it to be finding specific information about houses in a specific area. Others saw it as an opportunity to tell people how to find information about buying a house, rather than the way to buy a specific property. The Hone Buying Guide, http://www.newbuyer.com/homes/homeguide/, falls into the latter category.
- The task of describing how to use a mouse also led to several types of answers. Some people described how to connect one to a system, and some described its actions.
- As most people noted the statement x = x + 1 in nonsense if the context is mathematics. In computer science, however, the statement makes sens and is representative of the basic notion that the symbol '=' is not treated as representing equality in most programming languages. Rather it represents the operation of assignment, evaluating the expression on the right of the sign and storing the result in the location represented by what is on the left of the assignment symbol. I read x = x+1 as x becomes x + 1. The value that is stored in the location named as x is increased by 1. That makes perfect sense, as long as the value stored in x represents a number. If we had declared x to be of type String with String x = "Ernie", then adding 1 to x doesn't make much sense.

