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

The exam average was 68 and the median was 68. If you got below a 60 on this exam, you might not be prepared for this course.
If you got below a 50 on this exam, the exam indicates that you are not prepared to continue with this course and you must see me.

Grades are available on Blackboard.

Some comments on particular problems:

  1. This is a code segment. You do not need to write a class. You do not have to declare x.
  2. Make sure you write clearly and distinguish between upper and lower case when you write Math.sqrt(2).
  3. The simplest solution is shown, but you can also initialize the array with 4 assignment statements or with a loop.
  4. We did this one in class.
  5. Don't forget to add 1.
  6. Here, you should delcare the Random object outside the loop.
  7. The wording in these three problems is important. Only the first should use an if-else and should always print a message. The other two only sometimes print a message.
  8. A number of people used integer division. Either declare the sum to be a double or cast before dividing.
  9. The main problems here were integer division and arithmetic.
  10. The statement of the problem did not indicate a value for a 40-watt light bulb, but the mehtod must return a value in this case. Any value will do. I did not take off if you did not handle this case, but the compiler would complain. In this problem you are to write a method that returns a value. It should not print anything.
  11. Here you did not have to explain what each line of the program does.
  12. The logic was a little harder in this one. Remember that each time you execute nextInt() it reads in a new number. You will have to save the number when it is read and test the saved value. The problem stated "This method does no prompting." I took off points if you printed anything.

Exam 1      solutions