CS 101 (Fall 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]


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 installing the class software on it.

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. We suggest that you mount your CEC files remotely. See the next question for that.

I want to work on my assignments from my PC in my dorm room. How can I use my home directory at CEC?
Read Mounting your CEC directory in the comfort of your dorm room . We recommend you keep your files at CEC because they back up their files very often.

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]
The student page isn't up for CS101 -- how do I get my picture?
There is a new university policy that prohibits our publishing the names of students in our class. Please get your picture from Faces, via webstac if you wish.

You are not obligated to put up a home page.

I can't seem to print from Emacs, what should I do?
Well, it should work, but it's not. So, brace yourself, and follow this guide to set the printer specifically to tornado (recommended for CEC labs).

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.
How do I change where I print to from Emacs?
See this guide

Lab 1:

[an error occurred while processing this directive]

Lab 2:

[an error occurred while processing this directive]
The eyebrows keep rotating in the same direction even though the Emote is getting oppositely happy.
You must base the rotation not on the current happiness of the Emote, but rather on the difference between its previous happiness and its current happiness.
I resize my mouth, but it flips up and down, or it doesn't change size at all.
The problem is that if it ever gets size 0, then it can't be resized again. Also, there seems to be a problem with resizing a shape to a negative size if it is already of a negative size...it flips around.

Solution: remove your old shape from the canvas, add a pristine new Shape, like the one you put in when the object was constructed, and then resize that, negatively if you like.

Why does Emote extend DrawingPane?
It shouldn't...the provided software has changed, and you may have an older version. Just delete the "extends DrawingPane" and you should be fine. In the provided code, we assign the DrawingPane for you; look in the constructor for Emote.java.
How do you compute the slider's fractional value?
Divide its (current value - min value) by its (max value - min value)
What is the difference between AnyColor and Color?
Color is built into Java, and this kind of class is what is needed to color a Line, Rect, Ellipse, etc.

AnyColor and WebSafeColor are classes we give you that have extra features, but you have to study the API to understand how they are used. For example, you can do the following:

  AnyColor base = new AnyColor(Color.blue);
  Color lighter = base.desaturate();
Note that the desaturate() method returns a Color, not an AnyColor, but you could then turn around and make it an AnyColor by:
   base = new AnyColor(lighter);

Lab 3:

[an error occurred while processing this directive]

I can't find the constructor for Emote(int, int, int, int)
Redownload the Emote .class files from the Lab 3 webpage.

My Emote doesn't seem to smile or frown much
See the note below, but don't worry too much if it doesn't show much emotion. At the small scale it's instantiated for this game, there isn't much room for the smile to change.

A note about using Emote from Lab 2 to Lab 3
The setup for Lab 3 needs an Emote whose happiness ranges from 0 to 4. If you use your own Emote, just arrange for its Sliders to be constructed with this range. If you use our Emote, the way to do this is to use the following constructor in the Emote we provide.
  Emote e = new Emote(0,4,width,height)
where width and height are of your choosing.

Lab 4:

[an error occurred while processing this directive]
My picture is upside down! Or, things seem to rotate clockwise instead of counterclockwise when I use rotateAbout.
You're right, sorry, it does seem to do that. Please adjust your code accordingly.

Lab 5:

[an error occurred while processing this directive]
How do I use the bounds parameter to get coordinates of the supplied Rectangle?
See

The picture doesn't show up unless I hide and unhide it
setPixel(....) only changes the image of the picture in the computer's memory, not on the screen. To get the screen updated, send your PictureComponent (pic) a redraw() message. This could be done after each change using setPixel, but then your code will run slow. Think about doing it after each row, or each 5 rows, etc.

I need help using JavaDoc
The online page for Lab 5 has been augmented to include links to Sun's JavaDoc page as well as to include examples of how we use JavaDoc.

I'm lost when it comes to converting pixel coordinates to fractal coordinates.
Let your Mandelbrot object have two instance variables: It is thus always true that the upper-right corner of your screen is equal to minPoint.add(fractalDim)

Let the width and height of your display in pixels be w.

My zoom operation doesn't work.
Be careful of the interaction between your method that converts pixels to fractal coordinates: it probably depends on some instance variables that you want to modify in your zoomto method. You may need to introduce local variables to capture the new values for your instance variables and then update them at the end of zoomto.

I need help with drawing the screen
Try to write a method called void render() that iterates over each point p of the pixel space in your display (this can be done with two, nested while loops.

Lab 6:

[an error occurred while processing this directive]
My masses don't move
Make sure you have "told" each mass waht its left and right springs are by using setLeftSpring() and setRightSpring(), methods called on a Mass.

Lab 7:

[an error occurred while processing this directive]
How do I show the image in card?
Remember that the images are stored in a subdirectory called cards. Also, the lab notes say that you should instantiate the PictureComponent for a card only once, returning the same value each time. Thus, in the setVisible method of card, you want to issue a message setImage to your PictureComponent, passing it the file name of the image that you want to show.

If the card is not visible, then pass it "cards/back.gif". Otherwise, use "cards/"+toString()+".gif" to pass it the right filename for this card.

How can I generate a different rank/suit than the base one?
You can always within the Card class make a new Card and then change that card's instance variables through assignment. Example: Let's say you need to return a new Card whose rank is one higher than this Card's rank:
  Card c = new Card();
  c.rank = this.rank + 1;  // assumes rank is an instance var, private
  return c;
would return a new Card whose rank is one higher than this one's.

A better approach is to offer a private constructor that takes in the required information:

  private Card(int rank, int suit) {
     this.rank = rank;
     this.suit = suit;
  }
so then you can
   return new Card(this.rank+1, this.suit)
to accomplish the same thing as I showed above.

I am doing a perfect shuffle, but the output doesn't match the provided solution nor the description in the Lab 7 document.
It's not your fault. The document and provided description do a reversal of the deck.

You will get full credit for this part if your code

Lab 8:

[an error occurred while processing this directive]
Can I augment Card so that it exposes rank for BlackJack?
OK, but you can also get by without that. You can always compare a card against a known card such as a 7 and tell that its rank is 7.

I am using the class-given version of Lab 7, but the add(Deck) method is missing from Deck.
Extend Deck into MyDeck and put the extra methd in MyDeck. Then, use MyDeck instead of Deck throughout the lab.

I just replaced the Deck class, so the zip file now has the one from Lab 8.

How do I implement int[] getPossibleValues in Hand?
You don't need to -- it is extra credit. For this lab, you can assume that

What do I need to turn in for design?
You should turn in JavaDoc for any classes that you would put in Lab 8 that are not already in Lab 7. Don't redo documentation for the classes we give you, but instead think of the classes you need to play blackjack. As examples, consider the following entities: As said in class, think about playing the game as a dialog with yourself and a friend, and see what kinds of "messages" you must send each other to get the design going.

Can you help me with mouse listener stuff?

Lab 9:

[an error occurred while processing this directive]
Are there any changes to what we are given from the printed lab book?
Yes, glad you asked. I decided to give you Calculator so you don't have to do that part yourself. Concentrate on the representations part.

Lab 10:

[an error occurred while processing this directive]

Lab 11:

[an error occurred while processing this directive]

How can you make the blocks fall?
I suggest the following.
  1. In response to a click, build the set of blocks that surround the clicked-on block and that are the same color. Call this set S.
  2. If the sizeOf() set S is greater than 1, continue by calling some method, say byebye() on each Square in that set S. The method byebye() could do the following
    1. The canvas Rect associated with the Square is removed from the appropriate DrawingPane.
    2. The gameboard is affected by setting the appropriate [i][j] location to null.
  3. Now iterate over the gameboard from bottom to top. At each [i][j] location, where [i] is the row and [j] is the column, check whether the [i][j] location is null. If it is, then in another inner loop, look above [i][j] to the top of the board for a non-null spot. When you find one, move that square to [i][j].


Last modified 10:57:28 CDT 21 August 2000 by Ron K. Cytron