University of Toronto - Fall 2000
Department of Computer Science

Assignment 3 Announcements

Sunday 8, October: throws clause for main

Question:
Can I add a throws clause to main?
Answer:
Yes. In fact we've now added one to the code.

Saturday 7, October: flush

Question:
Ok, so I read the textbook and the API, and they don't seem to agree on whether flush should be used between output and input. What do I do?
Answer:
This is a common situation (contradictory or incomplete documentation) in `real life'. The short answer is: be safe and use flush and then test your code. But since not every student will see this answer in time to adjust their code, we will not check for the use of flush on this assignment.

Saturday 7, October: Input and Output

Question:
How do I do input and output?
Answer:
Reread chapter 3 of the textbook, and consult the API reference.
Question:
What do you mean by reread?
Answer:
The Lecture and Reading Schedule in the course outline says to to read it carefully in the third week.
Question:
It's too boring and/or complicated and anyway aren't the lectures supposed to cover everything?
Answer:

Reading technical material is a skill you have to develop. Jobs in IT require a large amount of reading.

For example: the Java API reference for this course only references a small part of the whole API, and the whole API grows every couple of years. No one knows the whole API, but people who program in java know how to use an API reference to learn the parts of the API as they need them. Even if you could memorize and understand the whole API during your first year of university (we don't teach java in later year courses), it will have grown by the time you look for and start your first job.

Question:
So how do I learn to read technical material?
Answer:
Practice. And by going to office hours (bring your textbook and API) and asking "How do I learn to read technical material?".

Saturday 7, October: Testing and main

Question:
Do I have to make a main method for each part? Do I have to make a project for each part? How do I test my code?
Answer:

To test your code you can make your own testing class (or classes) with a main method in it which calls methods from the other classes. You don't have to submit this testing class (we will ignore it).

For the last part of the assignment the class GetAWish has a main method in it.

How you organize your (CodeWarrior) project(s) is up to you. A project is mainly a way to let CodeWarrior know where to find your code, and a way to specify which class's main method to use when you ask CodeWarrior to execute the code. See the CodeWarrior survival guide under the Java and CodeWarrior Links (see our course's main page).


Friday 6, October: waitForGo's BufferedReader

Question:
Who "gives" waitForGo its BufferedReader?
Answer:
It's passed as a parameter by code that calls waitForGo. Prof. Clarke has a discussion of why it's not a good idea to use two BufferedReaders for the same input source.

Friday 6, October: isAffirmative and empty Strings

Question:
How can isAffirmative handle empty Strings without using if?
Answer:
You may assume that the String it's given isn't empty.

Thursday 5, October: Helper methods

Question:
Can I make some helper methods to use in this assignment?
Answer:
It's not necessary, but it is allowed where appropriate (e.g. to replace repeated code). But don't define any new classes.

Wednesday 4, October: Typo in the GetAWish comments

Question:
Shouldn't the comments in GetAWish.java say "motorcycle", not "motorcylce"?
Answer:
Yes, the file GetAWish.java has been fixed.

Monday 2, October: Missing question to the user

Question:
The second question to the user in the comments for GetAWish is missing.
Answer:
The file GetAWish.java has been fixed, the second question is now there.

Monday 2, October: Clarifying the judgement message

Question:
In the comment for the method judgement of Wish, I don't understand the description of what text to return.
Answer:
The file Wish.java has been modified, the comment should be clearer now.