Programming Assignment Checklist: Loops


Frequently Asked Questions

What are the goals of this assignment? To write several small Java programs so that you get accustomed to: using conditionals, loops, and arrays, and to debugging your code.

What preparation do I need before beginning this assignment? Read Section 1.3 and 1.4 of the textbook. You may also find it instructive to work through some of the other exercises and look at the solutions on the booksite afterwards.

How should I format my Java code? Follow the style from lecture and the booksite.

How much do I need to comment my code? In general, you should describe what you are doing and why you are doing it (but not how you are doing it). Each file must contain your name, precept, login, a description of the program, and how to execute it. Also, include a comment for each variable, for each flow-control statement, and for each logical chunk of code. Choose descriptive variable names. Use some discretion - for example, do not comment a loop index variable i or name it theLoopIndexVariable.

What exactly is a 4-by-4 checkerboard? It has a total of 16 asterisks, 4 per row. Each row has 8 characters, alternating between asterisks and spaces.


    * * * *
     * * * *
    * * * *
     * * * *

What's a fair die? It should return an integer between 1 and 6 with equal probability.

Submission

Submission. Name your programs exactly as we specify, being careful to use the same capitalization.

readme.txt. As always, download our template readme file and answer any questions. It is the file named readme.txt in the directory loops.

Possible Progress Steps

These are purely suggestions for how you might make progress. You do not have to follow these steps. The key to writing correct programs is to develop them incrementally, testing after each step.

A drunkard's walk. This is similar in many ways to the gambler's ruin example from lecture and the textbook. The key to building a larger program is developing it incrementally.

Dice and the Gaussian distribution.

Enrichment

Here are some famous and not-so-famous quotations about learning to program.



COS 126 Assignments
Kevin Wayne