CS 101 (Spring 2000)
Frequently Asked Questions (FAQs)

We hope the following list of questions and answers is helpful. However, if your question isn't answered below, we want to be sure that you get an answer! Check our help page for for times when help is available and information about other sources of on-line help.

[General Questions] [Lab 0] [Lab 1] [Lab 2] [Lab 3] [Lab 4] [Lab 5] [Lab 6] [Lab 7] [Lab 8] [Lab 9] [Lab 10] [Lab 11] [Lab 12]


General Questions:

[an error occurred while processing this directive]
Do I need any computer science background to succeed in CS101?
No. The only prerequisite for this course is that you be comfortable with algebra and geometry at the high school level. No programming background is required. We start from the beginning. However, the course is demanding and does move rather quickly. If you're looking for an easy course, this isn't it.

I have some programming experience. Will I be bored in CS101?
If past semesters are any indication, you probably won't be bored. Things may seem a bit slow at the beginning, but this course can be understood at many different levels. Also, the material should be sufficiently different from what you have seen to keep you interested. However, if you have significant experience in object-oriented programming, particularly in Java or C++, you should discuss your background with the instructor to determine if the course is appropriate for you.

Should I take CS100 along with CS101?
CS100 is a 1-unit course that will acquaint you with the computing resources at Washington University and teach you how to several computing tools. If you are not familiar with these tools, we recommend that you take CS100 along with CS101. However, it is not required.

How much time should I expect to spend on CS101?
CS101 emphasises learning by doing. Most of your time outside of class will be spent on lab assignments. You will spend very little time reading, since everything you need to know will be covered in lecture or in the lab assignments. Since CS101 is a 4 unit course, you should expect to spend about 10 hours per week on average doing the lab assignments. Some weeks will require more time, some will require less.

Is there a textbook for CS101?
Yes. However, the book is a resource that cannot replace class attendance. Everything you need to know will be covered in class or on lab assignments. On-line lecture highlights will be provided to assist your studies. If you own a computer, consider purchasing your own copy of the Symantec Cafe programming environment.

Do I need a CEC account for CS101?
Yes. CEC (Center for Engineering Computing) provides educational computing support for the School of Engineering and Applied Science. You will need a CEC account in order to participate in your lab sections. If you are an Engineering student, you should already have an account. Otherwise, you should read Getting a CEC Account.

Do I need to buy a computer for CS101?
No. You do not need to own a computer to take this course. The Center for Engineering Computing (CEC) has a PC Lab in Sever 201 that is generally open 24 hours a day, 7 days a week for your use. Should there be a temporary change to CEC lab hours, you will see the updated information in CEC's Message of the Day.

I own a PC or a Macintosh. How do I set it up to work on the CS101 assignments?
Read Setting Up Your Computer for CS101.
How can I go back to a previous CS101 web page?
The CS101 pages use frames, so the back arrow at the top of your browser may take you out of the CS101 pages completely. To go to a previous or following frame, hold down the right mouse button over the frame and select the appropriate option from the popup menu.

I'm having trouble with my personal computer. What should I do?
CEC's FAQ page on the three systems may have the answer you need. CEC also has consultants to answer general questions about computer use. However, please see the CS101 teaching assistants for any questions that specifically relate to the course.


Questions About Lab Assignments:

Lab 0:

[an error occurred while processing this directive]
How do I use the PC's in CEC to do my CS101 assignments?
Read Using CEC in CS101

I selected "Emacs for Java" under "Programming" in the Start menu, but emacs doesn't start. Instead, a strange batch file comes up in Wordpad. What's wrong?
Some of the CEC machines are misconfigured to open the batch file instead of run it. Until that is fixed, you'll need to do the following on those machines:
  1. Select "Run..." from the start menu.
  2. In the box, type P:/emacs, and click "OK"
  3. Press the right mouse button on the file called cs101-emacs or cs101-emacs.bat, and then choose "open."

Where is the CS101 Mailbox for turning in assignments?
We won't be using the mailbox this semester. Submit your assignment in class.

Lab 1:

[an error occurred while processing this directive]

Lab 2:

[an error occurred while processing this directive]
How should I place the shirt on the canvas?
The shirt should be centered with respect to the trunk. To facilitate this, use canvas.getHeight() and canvas.getWidth() to get the overall height and width of the canvas, respectively.
Why doesn't the provided solution work under Netscape and Internet Explorer?
We are working on this -- sorry for the hassle, but those platforms are not running our Java 2 applets correctly at this time.

Lab 3:

[an error occurred while processing this directive]
What is null?
An object declared to be a particular type, say Shirt can reference any shirt. Additionally, a reference variable can refer to "nothing" by setting it to null, as in:
Shirt s = null;
If you try to invoke a Shirt method on a null reference, your program will terminate with a runtime error.
Why do we use null?
null essentially means, "no object here". For now, we use the null reference to indicate an error state, i.e. I didn't have the resources to make a Shirt, so I made nothing, and here "it" is.
How can null be used in a program?
You can check to see if an object is explicitly null using = =, and then do something about it if you want.

Lab 4:

[an error occurred while processing this directive]
How do I draw a colored line?
The Line class included with the canvas package lets you do this. For example,
  Crayon pretty = new Crayon(4);
  Color  color  = pretty.getColor();
  canvas.add(new Line(x1,y1, x2,y2, color));
makes a number 4 Crayon, then gets its color, and then uses the color to draw a line from(x1,y1) to (x2,y2).

Lab 5:

[an error occurred while processing this directive]

Lab 6:

[an error occurred while processing this directive]

Lab 7:

[an error occurred while processing this directive]

Lab 8:

[an error occurred while processing this directive]
How to I allocate an array of an object type?
Suppose you wish to allocate an array of 7 Tableaus:
   Tableau piles[] = new Tableau[7];
allocates 7 Tableau fingers, indexed from 0 to 6. Each finger is null.

To establish each finger:

  int i = 0;
  while (i < 7) {
     piles[i] = new Tableau();
     i = i + 1;
  }
Why does my implementation allow me to move multiple cards from the top of a Tableau to a Foundation pile?
This is probably happening because transferTo is only checking that the bottommost card you've selected is transferable. To fix this, make sure transferTo only succeeds when all cards are transferable. This is tricky! Ask for help if you need it.
I am getting strange exceptions thrown when I try to move cards on the Tableau
You may be missing the condition which allows cards to be added to a Tableau when the topmost card is invisible. This was added to the design after the lab was handed out. Sorry!

Lab 9:

[an error occurred while processing this directive]

Lab 10:

[an error occurred while processing this directive]

Lab 11:

[an error occurred while processing this directive]
How do I use drag and drop?
The canvas has been modified, and the zip file containing it and terminal can be found here

In the new canvas, Rect and Oval both extend DropDragShapeComponent, which can be dragged and dropped. The use of this is discussed in class. Any object that extends Rect or Oval can override the following methods:

When I move a piece, it disappears, or it doesn't show up in the first place
The squares are filled, and they can hide what is behind them. To get the pieces up-front, add them to the canvas first, and add the squares later. (You can do this by building up a list of squares and adding them after all pieces are added).
I see that Set now has a find method. How is that implemented?
See the reference implementation for SetA

Lab 12:

[an error occurred while processing this directive]


Last modified 12:07:04 CST 27 January 2000 by Ron K. Cytron