Link Search Menu Expand Document (external link)

CS142: Homework 1

Homework problems are intended to give you more practice with shorter programs than the larger “projects” do. Typically these problems will also give you an idea of what you might see on tests. You also get immediate feedback.

For this homework, you will write some small programs using a website called CodeCheck. This website lets you program your solutions in the website itself, but I recommend making an IntelliJ project and doing your work there, because often it’s easier and faster to write and test in IntelliJ than directly in CodeCheck.

How CodeCheck works

  • You will be given a URL to a CodeCheck assignment which consists of a series of short programming problems.

  • When you first load the assignment it will generate a “CodeCheck ID” for you. This is a unique identifier that you will submit to Canvas when you’re done with the assignment; it lets me match up your assignment with your name.

  • If you use the same computer all the time, your CodeCheck ID is automatically saved in your browser and when you come back to the assignment, all your work will be restored from where you left off. However, CodeCheck also generates a “private URL” that you can save as well that will enable you to retrieve your work from a different computer. Note that if you clear your browser’s cache or cookies, the CodeCheck ID is forgotten and you’ll need the private URL to get back to your work.

  • In other words, you should bookmark the private URL (or copy and paste it somewhere) since that will always enable you to get your work back.

  • Click on the numbered buttons below the private URL to move between problems. Each problem requires writing a piece of code. When you think you’ve solved a problem, you can click the “CodeCheck” button to run the code, and the website will tell you whether your code works or not. You can do this as many times as you want; there is no penalty for doing it often, and only the last attempt is recorded.

  • I recommend copying each problem into IntelliJ to work on it. Note that the name of a class in Java must be saved in a file with the same name. So for instance, for the first problem, note that it’s in a class called ForLoop, so you should make a class in Java also called ForLoop, then copy and paste the code into that file.

OK, I get it, let’s get going!

Here’s the URL for the assignment: https://codecheck.io/assignment/21090220439s46v43pvnhbgoseujats2tze.

Turning in the homework

You can turn in the homework in one of two ways. The easiest way is to paste your CodeCheck ID into the Canvas assignment and submit it.

The second way is you can take screenshots of your code and submit those to canvas instead. In the past, a handful of students have said they’ve experienced problems with CodeCheck not saving their progress, so this might work better for you.