# CSE 142, Summer 2020: Resources

## Practice-It!

Database of old exam questions that will tell you if your solution works. Practice-It problems will be posted on the calendar each lecture day. You can use these posted problems to check your understanding of the material covered on that day in class. You will need to make a new account to use Practice-It!

You can access Practice-It! here.

## Labs

Students can sign up for an optional "CSE 190" programming lab for a 5th CSE credit to supplement the CSE 142 course. In this lab, each student will work at a computer for 60 minutes once per week to solve programming problems. TAs will be present to help answer questions. You will be asked to read the textbook material for the Monday lecture prior to attending the lab, which should take approximately 30 minutes each week.

You can view the labs page here

## Software

Instructions for setting up software for this class can be found here.

## jGRASP Tutorial

### Using the Debugger

The debugger lets you run your program partially and then stop it. From there, you can run each line one at a time and see the results. To use it, first you must tell jGRASP where to pause the execution; this is called a breakpoint. To set a breakpoint, move your mouse cursor to the left margin of your file's editor window until the cursor becomes a stop sign, and press the left mouse button.

(One good place to set a breakpoint is on the first line inside your main method, so that you can step through the entire program's execution.)

Once you have set the breakpoint, compile your program (if you haven't already) and then press the ladybug icon to run it in debugging mode.

The program will run until it hits the line of your breakpoint. Then the execution will pause. The next line to execute will be highlighted.

Notice that near the top-left corner of jGRASP, there is a new set of buttons. These buttons control the execution of the debugger. From left to right, their behavior is the following:

• Step Over: Executes the current line. If the current line is a method call, runs that entire method call.
• Step In: Executes the current line. If the current line is a method call, jumps inside that method and pauses at its first line of code.
• Step Over: Executes all remaining lines of the method you are currently in, and returns to the place from which it was called. (If you click this while in your main method, it runs the rest of your entire program.)
• Run to Cursor: Executes lines until reaching the line where your keyboard cursor is sitting.
• Suspend: Stops the program. We won't use this option.
• Resume: Tells the program to continue executing until it is finished, or until another breakpoint is encountered.
• Auto Step: When you turn on this button and then press Step Over/In/Out, it will repeatedly perform that action.

The most useful of these buttons is Step In, so if you only learn to use one of them, make it that one. For example, we'll Step In to the call of drawEgg from our previous example. The result is the following:

Any output that results from the code as it is being run will appear in the bottom console pane.

If you're running a program that uses variables, all of the variables' values will be shown on the left as well. As you step through the code, if a variable's value changes, it will turn red on the left.

### Bracket Matching

Many bugs have to do with brackets, { and } . Students will have too many, too few, or just have them in the wrong places. jGRASP has a useful feature that matches pairs of brackets to help you track down these kinds of bugs.

To see which bracket matches a particular bracket in your program, hold the Ctrl key and hover your mouse over that bracket. The bracket, along with its matching partner, will highlight in gray.

### Opening Files in a Larger Window

jGRASP has as annoying default setting that causes newly opened files to appear in small box windows. To change this and make the files open in larger windows, click the third button on the bottom left of the jGRASP window.

### Enabling Line Numbers

Line numbers are useful so that you can find the line where a compiler error occurs. To tell jGRASP to number the lines of your program, press Ctrl-L or click View, Line Numbers.

## Textbook

Our required textbook for CSE 142 this quarter will be the following:

Reges/Stepp. Building Java Programs: A Back to Basics Approach, 5th edition. ISBN 978-0135471944

This required book was written specifically for this course and makes a valuable supplement to the lecture presentations. The book contains the problems we will assign you each week before your discussion section.

### Code Files

The textbook includes many sample programs. You can access a full set of code files that is organized chapter by chapter. This will allow you to download any of the programs and run them on your own computer.

### Video Notes

New copies of the textbook come with an access code to watch "Video Notes." These videos supplement the lecture and book material by walking through more examples in detail. You can access the video notes at the Pearson VideoNotes web site.

### Online Problems

We have written a web application called Practice-It that allows you to write solutions to lots of our Java practice problems. You can type in your solution and submit it to the server to be tested. You will receive feedback about whether your code succeeds or fails.

### How to purchase

Physical copy: Students can purchase the textbook from the UW Bookstore. The book is also available to be ordered online from online retailers such as the following:

Digital copy: Students can purchase an electronic version of the textbook from the UW Bookstore. The book is also available to be ordered online from online retailers such as the following:

### Older Editions of the Textbook

If you see a book with our book's title but a different ISBN available for sale online (probably used), this is not the correct textbook. It is likely either the previous "1st edition", "2nd edition" or an even older "preliminary custom edition" version of the book that was used in past years. These older versions of the book do not contain all of the content from the correct course textbook. The 1st and 2nd editions are not suitable for CSE 142 this quarter; we do not suggest using them as your textbook for the course this quarter.