Announcements


A5. Here are a few points about A5. 1. Your Turtle window may act strangely if you put your mouse over it. There are some things about operating systems that are causing this, and we don't know why. Don't be concerned if you window acts a bit strange when you are changing its size or moving your mouse over it. 2. There is a typo in the specfication of function spiral, dealing with the lengths of successive lines. It should say
Another way to think about it: add d to the line length at each iteration of a loop. 3. A few students asked how many recursive procedures they had to write. We thought that the following sentence in the handout made this clear: one.
A4: times and comments. Here are statistics on the time spent on A4. This is only for 88 students; we don't have all the times yet:
For function truncateTo5, too many of you translated double parameter d into a string s and then went looking for a period in s to know how to truncate. Some wrote loops to append 0's, although we hadn't had loops. There is a simple way to write the body of this function. As we say in comments, (in other words), d + "" is guaranteed to have at least three characters. So the function body is simpl written as this:
For function roundTo5, many of you ignored the hints that what one did depended on the size of paramter d and first changed d into a string and then went searching for the period. Several answers were very contorted. Again, simplicity should reign. Here is how it can be done:
A4: About rounding. A few students came up with a strange case. There is nothing we can do about this. It has to do with the fact that the internal "floating point" numbers used for decimal numbers are, as you know, only approximations. Please read about the example below and perhaps put things into DrJava's interactions pane to verify what we say here. Put Math.round(7858.5) into the interactions pane and you get: 7859. Put Math.round(78.585*100) into the interactions pane and you get: 7858 !!! You can see why when you find the value of 78.585*100, which is: 7858.499999999999 This is because some decimal values are represented not exactly but by approximations. Because of this, a function call HSV.roundTo5(78.585) will produce "78.58" and not the expected "78.59". Don't worry about it, because it happens using our roundTo5 as well as yours.
Error in A4: Translation from HSV to RGB. The A4 handout said to use these formulas for
However, Wikipedia says:
Because
have the same value, so the simpler one can be used. Thus, we can use:
So, there is no mistake in A4. You can use the given formula for The Wikipedia formula is actually more complicated than it has to be. We will discuss this in class on Thursday.
About the CMS (Course
management system). We use a CSdesigned "course management
system" to manage assignments, tests, etc. DON'T DO ANYTHING
ABOUT IT UNTIL WE ASK YOU TO! Thanks. The CMS for this course
is at this URL: http://cms3.csuglab.cornell.edu/. Fix your PCs so that extensions (like .java and .doc) ALWAYS appear. To
do this, do the following: Open an explorer window. Use menu item Tools
/ Click on Folder Options. Click the view tab. Uncheck the box "Hide extensions for known file types". Summaries of lectures Seeing consultants,
TAs, and Gries The TAs have office hours. If you need some conceptual help of any kind, go the the TAs during their office hours. Choose any TA whose office hours are convenient for you, you don't have to limit yourself to your Section TA. Check here for office hours of TAs and Gries. You can make an appointment for a oneonone session with any TA at the undergrad office (Upson 303) between 9:30 and 4:30 MF, or by emailing: ugrad@cs.cornell.edu24 HOURS IN ADVANCE. Consultants for CS1110 live in the green room of the ACCEL Lab, which you
get to through the Engineering Library in Carpenter Hall. You may
spend a good deal of time programming there. The consultants are there
to answer your questions. If you need help downloading and setting
up DrJava, if you have a misunderstanding on an assignment, if you
are having trouble debugging a program —in
all such matters, ask the consultants for a quick answer. However,
they will not write your program for you.

