Announcements are listed with the newest announcement at the top and the oldest announcements at the bottom of this page.
Remember to check the announcements on the Main CSC108 web page as well as these.
A CDROM containing the Java software necessary to do your work at home is available at the Computer Science Student Union (CSSU) for $5 (including tax). The CSSU is located at EA106. The hours of the CSSU should be posted on the door of the CSSU one week in advance or you can call them at (416) 978-5354.
As of September 16th, students have access to the CDF-PC computer labs and most operations are running fine. If you need to print (there is no reason you need to this early in the term) you might have some difficulties. Also, the software to view postscript files might not be installed yet. Finally, the examples that normally come with jws (our Java environment) might not be installed. So don't worry if jws complains that it cannot find the examples.
Some of the Java code I used as examples is available on Dr. Clarke's web page. You might want to pop over to his web page and see all the links he has over there. If you just want to jump directly to the examples click here. The answers to the problems are the examples.
Here are some of the things students have been having trouble with:
If you look at the code for Applications.main() you will see two places you must fill in missing code. The first part is the student applying to the application centre. The second part is the universities telling the application centre if a student has been accepted.
Java starts numbering things from 0 so the first student name you enter is student number 0. The first university this student applies to is university number 0.
Carefully read the comments above each section of missing code, determine what is already being done, figure out what is missing, figure out how you would program that with the given information.
When you are in a method (like setAcceptance or addStudent) you have all the global variables (the variables at the top of the class, like student0 or accept0) and the parameters passed to the method (for example, int which or Student s).
Look at how things are done in one place and you can usually copy and paste lines of code. For example, how do you create a Student? Look at how you create an ApplicationCentre:
Application appCentre = new Application("Guelph");
The general format is:
ClassName variableName = new ClassName(parameterList);I figured out the parameterList for ApplicationCentre by looking at the parameters for a method called ApplicationCentre() in ApplicationCentre. To know how many and what type of parameters a Student requires, look at the Student class for a method called Student().
Look at the code you already have before you fill in the missing code. There is usually a reason for the code that is there. Maybe some of the existing code will make your task easier. For example, what is the studentCount += 1 in addStudent there for?
The line:
studentCount += 1;is the same as:
studentCount = studentCount + 1;
The toString method should tell you all about the object. So the toString method of Student should print out nicely formatted information about all the global variables in the Student class.
To do some experimenting I would do the following:
class Test {
// copy and pasted variables from Student class
public String name;
private String university0;
private String university1;
private String university2;
private String accept0;
private String accept1;
private String accept2;
public static void main(String [] args) {
// assign values to variables for testing
name = "Darrell";
university0 = "UofT";
accept0 = true;
// assign values to the other variables as well
// copy and paste the next line from Student class
String result = name + ":\n";
// you want to experiment with different values
// until you get result to hold all the Student
// information in a nicely formatted way. You
// will have to insert spacing to make it look
// good.
result = result + university0;
result = result + accept0;
// more variable information inserted here.
// everything above here is what we are testing
System.out.println(result);
}
}
Once you get the right output, copy and paste it from Test to the Student
class toString method.
In the getStudent method there is a line:
if (which < 0 || which > studentCount - 1)The || symbol is a logical OR statement. In english the above line would read, "if the value of which is less than zero OR the value of which is greater than studentCount minus one"
In lecture note 2 I talk about the unsigned modifier for integers. This is a mistake. The unsigned modifier does not exist in the Java language. Please disregard any mention of the unsigned modifier when using the Java programming language.
Are you completely lost? Look at learning Java like any other language. When you are learning a second language you tend to think about what you want to say in your native tongue, translate it into the new language and then write it out. You want to do the same thing when writing a Java program. Think about what you have and what you want. Then, in your native tongue, think about how you want to get from what you have to what you want. Once you have an idea of what you need to do then divide up the work into independant tasks (methods), group the tasks together and assign them to an 'individual' (class). Assign someone to coordinate the individuals and the tasks (the main method). All this is being done in your native tongue. Once you think you have all the information organized, try translating the steps into Java classes and methods. If the translation is not coming easily, try reorganizing or break the steps down into something simplier.
I am changing my office hours. For this week and next week I will have an office hour on Monday from 11:00am to noon and from 6:00pm to 7:00pm. My Thursday office hour will be reduced to 6:00pm to 7:00pm.
Starting the week of Nov 2 my office hours will change to Monday, Tuesday and Thursday 6:00pm to 7:00pm.
Dr. Clarke has posted some information about his midterm test. You might want to have a look at his page on How to write a programming test and his midterm from last spring. Click here.
The enrolment has changed so to balance the amount of work each teaching assistant has I am changing the tutorial assignments. When you are writing the midterm or handing in assignments you must attend the proper tutorial. Your assignments will be handed back in your assigned tutorial.
The CDF-PC computer lab had some difficulties yesterday night. For this reason a number of people could not print out their assignment on time. This means that the due date for assignment 2 has been changed. You can hand it in to me at 6pm in my office hour (SF4308B). If you get it to me between 6:00pm and 6:10pm it will be on time. After that time, it is late. You lose 10% for handing it in after 6:10pm the same day and 20% if you hand it in on Friday. If you don't hand it in by Friday it will not be accepted.
If you cannot drop it off to me at 6pm then you may submit it to the Department of Computer Science by asking them to put it in my mailbox. It would be better if you dropped it off at my office hour though... my mailbox is not very big so more than a few assignments could be a problem.
Correction to handout: The disperseHoldings takes two inputs. The Company object and an integer number of shares. The integer number of shares are the number of shares used when the Company object was created.
NOTE: the code in Assign3.java will indicate how to write the methods for ShareholderRegistry. You are supposed to make your code fit with the given code. You are not allowed to modify the given source code.
One of our teaching assistants has left so we only have four teaching assistants remaining. This means the tutorial assignments must change one more time (hopefully this is the last time).
For November 4th, everyone who was in Wentao's tutorial will go to SS2117 to pick up their midterm and second assignment. This is Douglas Small's tutorial. He did not mark your assignment 2 or midterm; bring any questions about your midterm or assignment 2 mark to me, your instructor.
After November 4th the following will be the tutorial assignments:
|
Your last is on the range: |
You go to this room: |
|
A to Ha |
UC87 |
|
Hb to Mo |
UC144 |
|
Mp to St |
WI524 |
|
Su to Z |
SS2117 |
The office hour for Tuesday, December 1st is cancelled.
In part 2 of assignment 4 you should assume that the statement:
LinkedStack a, b;occurred before the given code.
At the end of the term any unclaimed assignments or tests will be left at the Computer Science Student Union (CSSU) located in the Engineering Annex, room 106 (EA106). The room is not open all the time. It is managed by the members of the CSSU; since they have exams to write (or invigilate) the CSSU office might not be open. A timetable of when it is open should be posted on the door or possibly available on their web site http://www.cdf.utoronto.ca/~cssu/. I will be dropping off your assignments after the exam.
