CS 1713 Introduction to Computer Science, Spring 2012 Exam 2 Comments

The exam average was 56 and the median was 62
There were some very low grades on this exam.
If you got below a 50 on this exam, you need to take serious action.

This material is difficult and it takes some time to be comfortable using it.
The goal to to master this material by the time the course is over.
If you are doing all of the labs and projects and participate in class, you can make up for low grades at the beginning of the course by doing well on the final exam. However, if you got below a 50 on this exam, it is unlikely that you will do better unless something changes.

You should be spending at least 12 hours a week outside of class on this course.
If you are not doing well and are spending less time than this, you need to make a change.

Some comments on particular problems:

  1. Be careful in counting.
  2. This returns a String and does not print anything.
    You cannot use trim here because you to not want to remove trailing blanks.
    Also, trim removes other characters besides blanks.
    Some people answered a different question, the one that was a ClassQue question on several days.
    This one was simpler.
  3. This method prints something and does not return a value.
    You should not print a final comma.
  4. This is the same problem that you were asked to do for Recitation 3.
    None of the solutions took into account that we might have low greater than high.
  5. To do problems like this, pick one on the right side, and find the corresponding phrase on the left, marking those you have used.
  6. Any pair of two sides can be equal.
  7. In this class, attributes must be private. The constructor should set the inital values of the attributes. If an attribute is accessible, it needs a get method. If it can be changed, it needs a set method. The toString method always returns a String and never prints anything directly.
  8. A box for each variable and no arrows.
  9. A box for each variable and a box for each array element. Note that the arrays themselves do not have names.
  10. It is better to use a single instance if Random and call it twice. Notice that doing nextInt(6) twice and adding the results is not the same as one call to nextInt no matter what parameter you give it. It is more likely to throw a 7 than a 2.
  11. Many people did not take into account the case of an empty array (length=0).
    Nobody did the extra credit correctly.
  12. The only arrows go from a box representing an object variable to an object.

Exam 2      solutions