T-Th 9:05, Hollister B14
or
T-Th 11:15, Phillips 101

CS1110: Introduction to Computing Using Java

Fall 2011

Instructors: David Gries and Steve Marschner

Announcements

25 September Assignment A4
10 August Can't use Javadoc? Look here
10 August Using VideoNote
10 August Can't open the DrJava jar file
10 August Labs
10 August No serial number/device ID on your iClicker?
Register your iclicker, even if it's used.
11 August CMS (course management system)
11 August Make extensions visible on your PC
11 August How to get a summary of lectures
11 August Seeing consultants, TAs, Gries

Assignment A4
0. Using application a4.jar on the Macintosh. Some students with Macintoshes have not been able to execute the jar file a4.jar. Student Lee Carlaw found the problem and solution, at least on several Macintoshes. Thanks, Lee!

(1) Click the mac spotlight --the magnifier icon in the very upper right of your window-- and type "Java Preferences" in the field that shows itself.

(2) In the window that pops down, select Java Preferences. The Java Preferences window opens.

(3) In the "General" pane, you will see two lines with CPU-types 64-bit and 32-bit. Drag the 64-bit line above the 32-bit line.

That's it! If this doesn't work, let us know.

1. assert statements. In file A4Methods.java, function truncateTo5 begins with an assert statement:

assert 0 <= d && d <= 99;

An assert statement has the form "assert <boolean expression> ;". It is executed as follows: evaluate the <boolean expression>; if it is false, terminate execution with an assert-exception error message (if it is true, do nothing).

In the case of truncateTo5, the assert statement is the same as the precondition. Therefore, if the precondition is false and execution of the assert statement terminates the program, you have an error --either your program incorrectly calls truncateTo5, so you have an error in your program, or perhaps you incorrectly called it in the interactions pane.

Some people advocate leaving assert statements in a program to check for things like preconditions even after a program is completed and checked out, just in case there is one last bug that was not caught and might be caught this way.

2. Function min. If you have to find the minimum of two values, use function Math.min(x, y). Look in the API specifictions for it. Principle: use methods that you or others have written to save yourself time and energy.

3. Rounding. In two functions that convert to RGB, you are asked to round doubles to integers. DO NOT USE roundTo5Math for something suitable. Look in the API specifications. Class Math is always available; it need not be imported.

Can't use Javadoc. A number of student cannot use the javadoc button in DrJava on their computer. It usually is a PC running windows 7, and some Ecclipse software is on the computer --for example, the ECCLIPSE compiler is being used in DrJava; look at the compiler pane. Some students have been able to fix this by downloading and installing the JDK. Look here to see how to do that.

[Note. To run Java one needs a JRE: Jave Runtime Environment. To compile Java programs and do other things, one needs a JDK: Java Development Kit.]

VideoNote You can see lectures of a previous version of this course at www.cs.cornell.edu/videonote/cornell. Along with the video comes a table of contents; click on an item and the video changes immediately to the place corresponding to the item you clicked.

Use VideoNote as a supplement to the course. Look at a video if you want to go over some part. If you have to miss a lecture because of the flu, anther illness, an interview, a sports roadtrip, use VideoNote to see the lecture.

Don't use VideoNote to skip class regularly, as a prop to allow you to postpone studying, and so on. That will hurt you in the long run. Our study of the use of VideoNote shows that it can hurt rather than help the C- student who misses lots of lectures and procrastinates on studying because they feel they can catch up later with Videnote.

Together, the provost's office and the College of Engineering are spending $5,000 so that you can have access to VideoNote. Appreciate that.

Can't open the DrJava jar file. When you double-click on the DrJava jar file, that application is supposed to open up. However, there may be a problem with your Windows Operating system, especially if it is WIndows 7. If you have this problem, try visiting this website and downloading and installing application JarFix:

http://www.softpedia.com/get/Others/Miscellaneous/Jarfix.shtml

Labs. Please read these guidelines for labs carefully.

  1. You are expected to attend a lab session each week. You do not have to be formally registered in the lab you attend, but you should regularly attend the same lab. If you miss more than 3 labs (or don't do the assignment for 3 labs) without a reasonable excuse given to the Lab TA beforehand, we reserve the right to lower your grade a notch (e.g. from B to B-). We don't do this very often, but we reserve the right to do it.
  2. If you do not complete a lab the week on which it is handed out, complete it at home during the week and show it to your Lab TA the next week.
  3. Labs that are not completed by the next week will not be counted.
  4. Please do not email Profs. Gries or Lee about who to see or what to do if you missed a Lab. Talk to your LAB TA.

No serial number/device ID on your iClicker? This number, needed to register the clicker, can be recovered by bringing your clicker to (a) the Academic Technology Center Room 123, Computing and Communications Center on the Ag Quad, open 9-5; (b) the ATC's G27 Stimson Hall office near Day Hall, open 12-5; or (c) Prof. Gries and Lee's office hours, 167 Olin Hall, Tuesdays and Thursday 10:10-10:55.

Register your iClicker, even if it's used. Do so by visiting http://atcsupport.cit.cornell.edu/pollsrvc . You'll login with your netID and password, and you'll need the serial number, or device ID, of your clicker, which can be found, perhaps near a "bar code", on the back (you may wish to put some invisible tape over the serial number or write it down somewhere, since the numbers can rub off). Note that each individual student in CS1110 needs their own clicker.

CMS (Course management system). We use the CS-designed "course management system" to manage assignments, tests, etc. The CMS for this course is at this URL: http://cms.csuglab.cornell.edu/.

When you visit the site, you will have to give your Cornell netid and password. The CMS is not yet populated with the enrolled students. We will let you know when this has been done. For now, don't concern yourself with the CMS.

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
Please look courseOutline.html, which summarizes what we did in lecture each time!

Seeing consultants, TAs, Gries

Check here for office hours of 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.

You can make an appointment for a one-on-one session with any TA. Contact the TA.

Consultants for CS1110 hold hours in the green room of the ACCEL Lab, which you get to through the Engineering Library in Carpenter Hall. Here is the schedule for the consultants in the ACCEL Lab.

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.