CS1027b Computer Science Fundamentals II

Lab 3

Learning Outcomes

Upon completion of this lab, you should be able to do the following:

General lab instructions to help labs run smoothly

IMPORTANT. Make sure you attend the lab session to which you registered, show the result(s) of each exercise to your TA, and submit the .java files that you wrote through OWL by 11:55pm on the same day as your lab session to get your marks for the lab.

  • Download the files DebuggingExercise.java, DebuggingExercise2.java, DebuggingExercise4.java, and MyObject.java and create a new project. Download file AnswersLab3.txt and open it in a text editor.
  • Exercise 1

    Eclipse comes with a debugger which allows you to execute your code one statement at a time, see the values of variables, and stop the execution of the program at any point. The debugger is a very powerful and useful tool to help you find errors in the code. In this exercise you will use the debugger to trace through the program DebuggingExercise.java.

    Exercise 2

    Exercise 3

    Exercise 4