Assignment 1 - due Monday, October 4th, 4:45PM, Deschutes drop box

Please do work on your own - no group work. If you are stuck, contact me. Collaborating on this assignment will be viewed as cheating.

Problem 1

Read chapter 1 in Dewdney. Read section 3.6 in 3rd edition of Lewis&Loftus (L&L); read section 5.5 in 4th edition. (I assume everyone has one or the other edition.) Note that both sections in 3rd and 4th edition will use some programming concepts that we have not covered. However, the code in part a should be understandable with what we will cover in first week.

Make sure that you have JCreator downloaded and running correctly. You will need this to complete each part of this problem.

Part a. Type in the code at the top of page 166 in L&L 3rd edition, page 234 in 4th edition. Add the wrapper code that is necessary to make it compile and run. Compile and run it. Print out the results. You are free to change the values 10 and 50 to smaller ones to avoid lengthy printouts. Just make sure you tell me of the changes you make.

Part b. Download the Java wallpaper code seen in class. You will need two files:

Compile and run the code in Wallpaper. Verify that your output looks right. You do not have to turn in anything for this part, but you will need to get it right to move on to part c.

Part c. Change the two for-loops in the main method in Wallpaper to two while-loops. Use section 3.6 (or 5.5) as a guide. Compile and run. Your results should be identical to part c, i.e., changing from a for-loop to a while-loop should make no difference to the output given they are two different ways of doing exactly the same thing. Print out your new main method (with while-loops) and turn-in.

Problem 2

No problem 2 this week. However, if you want a head start, we will be looking at chapter 2 from Dewdney next.

The Drop Box

I would like hardcopy of your assignment. You must turn it in by the time given - the doors to Deschutes Hall will lock somewhere between 4:45PM and 5PM every weekday. If you wait until 5, you may be locked out. The drop box itself is located on the first floor in the main hallway. It will be marked with CIS 170.

Ethics

A note about the ethics for coding problems in the class. If you turn-in source code without further comment, I will assume that it will compile and produce the results you show. If I later find that it will either not compile or not produce the results you show, I view this as a major form of cheating. As such, I'll pass it through department and university channels set up to handle cheating cases. Be very careful to turn in the right version of your source code. If you cannot get your code to compile or produce fully correct results, say so. I'll give partial credit for good attempts.

End of sermon.