Fall Semester 2005


Sat Dec 17
Grades will be posted tomorrow morning, in Postem (link will be available here).

Grades have been taken out of OnCourse since management of grades is difficult there.

So OnCourse gradebook will no longer be updated. Postem will have all the updated grades.

Tue-Wed Dec 6-Dec 7
Script for final appointments (if needed) is here.

Wed-Mon Nov 30-Dec 5
FINAL EXAM is in GY126 between 7:15-9:15 p.m., on Thurs., December 15.

(See the Registrar's Page for confirmation of schedule. Scroll to bottom of page).

Wed-Mon Nov 30-Dec 5
The Dec 6 lecture notes contain a crossword puzzle version of the first program for Homework Ten.

Tue Nov 29
In Lab this week we will administer individualized makeups (mostly TBS).

Messages will be sent tonight detailing individually what you will need to make up on Friday.

Messages should be in your mailboxes before 8am tomorrow morning, Wednesday.

Your make-ups on Friday will be printed and distributed individually.

Wed-Mon Nov 23-28
THANKSGIVING BREAK.

Sat-Tue Nov 19-22
Homework Nine and Ten will be collected after the break.

Fri Nov 18
PRACTICAL EXAM in lab today. Exam review posted as Lecture Notes 23.

Jeremy will hold office hours 1-3pm today for next week's office hours.

Thu Nov 17
Script for individual appointments is here.

The script is for A348/A548 students as well.

There will be many more opportunities for individual appointments after the break.

Wed Nov. 16
Practical Exam in labs this Friday (based on all labs up to and excluding Lab Ten).

Lecture notes of Thu Nov 17 will contain a review and summary.

Fri-Tue Nov. 11-15
No more lab assignments (ten is the last one).

Last homework assignment is also ten.

Class notes updated to reflect this, code posted to be used with Homework Ten.

Thu Nov. 10
Test of Basic Skills in class today.

Wed Nov. 9
The Cannonball problem (P7.3) is is here somewhere.

Problems and solutions from A201 for your review.

Here's a slightly more advanced program for Homework Eight.

It takes care of the JComboBox on the right of the GUI.

Here's an implementation of P7.16 (whose solution was requested by e-mail).

Here's the code for P8.19 in the book (page 318, also requested by e-mail):

class Magic {
  public static void main(String[] args) {
    int n = Integer.parseInt(args[0]);
    int[][] sq = new int[n][n];
    int i = sq.length - 1;
    int j = sq.length / 2;
    for (int k = 1; k <= n * n; k++) {
      sq[i][j] = k;
      int ni = (i + 1) % sq.length;
      int nj = (j + 1) % sq.length;
      if (   sq[ni][nj] != 0
         || (i == sq.length - 1 && j == sq.length - 1))
      {
        ni = i - 1;
        if (ni < 0)
          ni = sq.length;
        nj = j;
      }
      i = ni;
      j = nj;
    }
    for (i = 0; i < sq.length; i++) {
      for (j = 0; j < sq[i].length; j++) {
        String num = "   " + sq[i][j];
        System.out.print(num.substring(num.length() - 3) + " ");
      }
      System.out.println();
    }
  }
}
If you want to see it in action here it is:
frilled.cs.indiana.edu%java Magic 3
  4   9   2
  3   5   7
  8   1   6
frilled.cs.indiana.edu%java Magic 5
 11  18  25   2   9
 10  12  19  21   3
  4   6  13  20  22
 23   5   7  14  16
 17  24   1   8  15
frilled.cs.indiana.edu%java Magic 17
137 156 175 194 213 232 251 270 289   2  21  40  59  78  97 116 135
136 138 157 176 195 214 233 252 271 273   3  22  41  60  79  98 117
118 120 139 158 177 196 215 234 253 272 274   4  23  42  61  80  99
100 119 121 140 159 178 197 216 235 254 256 275   5  24  43  62  81
 82 101 103 122 141 160 179 198 217 236 255 257 276   6  25  44  63
 64  83 102 104 123 142 161 180 199 218 237 239 258 277   7  26  45
 46  65  84  86 105 124 143 162 181 200 219 238 240 259 278   8  27
 28  47  66  85  87 106 125 144 163 182 201 220 222 241 260 279   9
 10  29  48  67  69  88 107 126 145 164 183 202 221 223 242 261 280
281  11  30  49  68  70  89 108 127 146 165 184 203 205 224 243 262
263 282  12  31  50  52  71  90 109 128 147 166 185 204 206 225 244
245 264 283  13  32  51  53  72  91 110 129 148 167 186 188 207 226
227 246 265 284  14  33  35  54  73  92 111 130 149 168 187 189 208
209 228 247 266 285  15  34  36  55  74  93 112 131 150 169 171 190
191 210 229 248 267 286  16  18  37  56  75  94 113 132 151 170 172
173 192 211 230 249 268 287  17  19  38  57  76  95 114 133 152 154
155 174 193 212 231 250 269 288   1  20  39  58  77  96 115 134 153
sluggo%

Tue Nov. 8
Here's the code we developed in class today.

(Note that Parcel.java remains unchanged).

Mon Nov. 5-7
Here's a sample TBS from this Summer.

(It's listed under the notes for Nov. 8 as well.)

Thu-Fri Nov. 3-4
Lecture Notes for Nov. 3 indicate precisely what Lab Ten, Homework Eight want from us.

Tue-Wed Nov. 1-2
These are the problems to review for the TBS:

Fri-Mon Oct 28-31
The first Test of Basic Skills will be on Thu Nov. 10, in class.

Additional details forthcoming.

Tue-Thu Oct 25-27
Here are the slides from Chapter 14 in the text.

And here's the code from the chapter.

Sun-Mon Oct 23-24
Lecture Notes for Oct 25 contain all the details for Homework Assignment Six.

Lecture Notes for Oct 27 will do the same for Lab Nine and Homework Assignment Seven.

Grades for the Midterm Exam will be posted soon.

Sat Oct 22
Lab Eight is due today:
the GUI part of the problem only is required
The rest is part of Homework Six.

Fri Oct 21
Homework Six, posted, asks for the solution to the problem listed in Lab Eight.

Help on Lab Eight has been posted (coordinates of the user interface given).

Thu Oct 20
Midterm Exam today in class 4:00-5:15pm.

Wed Oct 19
Programs developed in class yesterday have been posted at the end of the lecture.

Tue Oct 18
Here's the A201 final exam from Spring 2003 (note the inheritance related questions).

Here's an A201 final exam from Summer 2001.

And here's the final from Spring 2001.

The first is related to the lecture of last Thu, and so is this set of notes.

The other two are just for practice, if you so feel inclined.

Mon Oct 17
Don't forget: help session with Chris and Adrian today.

Swain East 045. 7-9pm. Everybody and every question welcome.

Sat-Sun Oct 15-16
The code developed in class on Thu has been posted.

Homework Assignments Six and Seven will be the problems in Lab Notes Eight and Nine.

The lab notes will be extended to give you a good warmup to be turned during the lab for these assignments.

Fri Oct 14
The lab assignment for today is: Guess the number in ten tries.

Flowchart is like this:

You need a basic GUI with a textfield, a button and two labels.

You must make the listener play like in the flowchart.

It's best (and simplest) if the listener is aware of the entire GUI.

Thu Oct 13
Sample exam posted, to familiarize ourselves with the exam format.

Some links: one, two.

Mon-Wed Oct 10-12
Notes for Chapter Twelve posted as Lecture Notes Thirteen.

Sat-Sun Oct 8-9
Great news: we have reserved a room for weekly help sessions to be held by Chris.

So Monday night live from Swain East with Chris Colvard 7-8:59pm will be a weekly fixture.

We hope it will also be a very popular event. Swain East 045. Mondays at 7pm. With Chris Colvard.

Reservation Card: 24567
A202 (Section 15131) Intro to Programming (10/10/2005 to 12/12/2005: 07:00 PM - 08:59 PM)
[SE 045] 10/10/2005 07:00 PM - 08:59 PM Seats: 27 Status: Confirmed
[SE 045] 10/17/2005 07:00 PM - 08:59 PM Seats: 27 Status: Confirmed
[SE 045] 10/24/2005 07:00 PM - 08:59 PM Seats: 27 Status: Confirmed
[SE 045] 10/31/2005 07:00 PM - 08:59 PM Seats: 27 Status: Confirmed
[SE 045] 11/07/2005 07:00 PM - 08:59 PM Seats: 27 Status: Confirmed
[SE 045] 11/14/2005 07:00 PM - 08:59 PM Seats: 27 Status: Confirmed
[SE 045] 11/21/2005 07:00 PM - 08:59 PM Seats: 27 Status: Confirmed
[SE 045] 11/28/2005 07:00 PM - 08:59 PM Seats: 27 Status: Confirmed
[SE 045] 12/05/2005 07:00 PM - 08:59 PM Seats: 27 Status: Confirmed
[SE 045] 12/12/2005 07:00 PM - 08:59 PM Seats: 27 Status: Confirmed

Fri Oct 7
We're converging towards the following diagram for the listeners:

There is a user interface and a listener attached to it, that knows all about it.

And when the listener is activated, the behaviour is always like the diagram above.

Thu Oct 6
Discussion of the game to be implemented in lab tomorrow.

What the listener has to implement.

Wed Oct 5
The quote for today is:
"That which we persist in doing becomes easier; not that the task itself has become easier, but that our ability to perform it has improved."
Ralph Waldo Emerson (1803 - 1882)

Mon-Tue Oct 3-4
Notice Homework Five contains a lot of review and is due right before the midterm.

Sat-Sun Oct 1-2
Your grades in OnCourse should be up to date (including Homework Two and Lab Four).

Lecture and lab notes for the week, Homework Five should be updated by Mon morning.

Fri Sep 30
Chris and I are coming through labs today.

Wed-Thu Sep 28-29
The following problems are very good practice for TBS:

We will post solutions to these problems as we move alonfg.

Tue Sep 27
Here's the basic framework for the projects in chapter 5:
import javax.swing.*;
import java.awt.*;

class One {
  public static void main(String[] args) {

    JFrame a = new JFrame();

    Container c = a.getContentPane();
    c.setLayout(null);

    a.setSize(400, 400);
    a.setTitle("How are you?");

    Two t1 = new Two();
    t1.setBounds(0, 0, 21, 21);
    c.add(t1);

    Two t2 = new Two();
    t2.setBounds(100, 100, 21, 21);
    c.add(t2);

    Two t3 = new Two();
    t3.setBounds(50, 50, 21, 21);
    c.add(t3);

    a.setVisible(true);
  }
}

class Two extends JComponent {
  public void paintComponent(Graphics g) {
    g.drawRect(0, 0, 20, 20);
  }
}
If you recall the code from the book had some problems.

Hopefully all is consistent (with the labs and with the book) and entirely error-free right now.

Message sent to the distribution list, update for the week of Sep. 26-30:

Dear A202/A598/I210 Friends,

I very much appreciate your determination and hard work and as I
understand the homework assignments are a bit overwhelming. Here
is how things will progress from here on:

a) Homework Three stays as it was, and is due tonight. In class
today we will try to give a little bit last minute help with it.

b) labs stay as planned, and template code will be posted during
the week and will be discussed by lab instructors in labs every week.

c) lectures from now on will focus (as they should) exclusively on
the reading assignments from the book. Today: chapter 8.

d) homework assignments from now on will ask you to work your way
through the programs developed in the case studies in the chapters
and reading assignments in the book. You need to make sure that you
identify what's being developed, type those programs in, compile and
run them, think about them, and how you would implement them if you
were to get them on an exam (such as the midterm exam).

Thus the task for the lab is fairly well structured (given the code
posted and the readily available guidance of the lab instructors in lab)
while homework assignments better blend in your reading assignments and
study for the written exams.

Homework Four for example, due next Tuesday, asks you to go over the
two programs developed in sections 7.5 and 8.6. Since the code is that
from the book cheating will NEVER be an issue, but expect your AIs to ask
you questions from the assigned case studies, and be prepared to solve any
of the assigned case studies on any of the upcoming exams. This should
also make exams a bit more predictable.

Please let me know if you have any questions or need any help.

The rest of the homework assignments will be posted tonight.

... Adrian

Mon Sep 26
Homework Three remains unchanged, but we will scale down on all the others.

Fri-Sun Sep 23-25
Here are grading guidelines for our latest assignments.

Thu Sep 22
The three programs posted are really almost what Lab Four is asking for.

Help with Homework Three will also be posted today.

Wed Sep 21
Programs for lab on Friday listed on the Class Notes page, under the lab entry.

You have to start from the programs posted and finish them.

Tue Sep 20
Today in class we will start using this program.

Andy will not be holding his Wednesday 2:30 - 4:30 pm office hours this week (Sept. 21st).

They will be moved to Friday, Sept. 23rd, 12:15 - 2:15 pm in LH 201D for next week only.

Here's how you'd play with the triangle (once the class exists):

class Experiment {
  public static void main(String[] args) {
    Triangle a = new Triangle(new Point(0, 0), 
                              new Point(0, 3), 
                              new Point(4, 0));
    System.out.println(a.area()); // prints 3 * 4 / 2 (that is: 6 (six))
  }
}

Sat-Mon Sep 17-19
Lecture notes Seven, help with Homework Two's cash register problem, posted.

Fri Sep 16
Use Heron's formula to calculate the aria of a triangle.

To calculate the angles use one of the other formulas for the area.

Thu Sep 15
Reading assignments are now rated, as follows:
Highest ranking: most difficult, mostly new concepts
Intermediary ranking (there are 11 rankings available)
Lowest ranking (sports column level, very basic information)
Also, in class today we will discuss the problems listed at the end of chapter 3.

Wed Sep 14
From now on lab assignments are due the Saturday following the labs.

All homework assignments are due on Tuesday night (Homework Two is due next Tuesday).

Everything else remains unchanged, lectures will try to help you more with the reading assignments.

Here are the guidelines for grading Lab Two and Homework One.

Tue Sep 13
Important information from our A201 days to be reviewed:

Chapter 3 is a really important one, so we should spend more time on it.

Fri-Mon Sep 9-12
Lab Notes Three completely cover the design issues of the two programs.

Also:

  1. Lab Assignment One (reopened on Fri) is open until the end of the day today, in OnCourse.
  2. Homework Assignment One (reopened on Fri) is open until the end of the day tomorrow (Tue), in OnCourse.
  3. Lab Assignment Two, stays open until the end of the day Wednesday, in OnCourse.

Homework Assignment Two is due on Wednesday, in OnCourse, as originally planned.

Lectures on Tue and Thu this week will directly address the eight problems in Homework Two and Three.

Thu Sep 8
Here's a program (based on an idea of Andrei Patrulescu) that you may find helpful:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

class Three {
  public static void main(String[] args) {
    JFrame frame = new JFrame();
    Container c = frame.getContentPane();
    c.setBackground(new Color(0.66f, 1.0f, 0.66f)); 
    c.setLayout(null);

    JTextField t = new JTextField();
    t.setBounds(10, 120, 70, 20);
    c.add(t);

    JButton u = new JButton();

    KeyBroker k = new KeyBroker(u, t);
    t.addKeyListener(k);

    u.setBounds(100, 20, 90, 30);
    u.setText("Erase");
    c.add(u);

    ButtonBroker b = new ButtonBroker(t);
    u.addActionListener(b);

    frame.setSize(300, 300);
    frame.setVisible(true);
    
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }
}

class KeyBroker implements KeyListener {
    JButton a; 
    JTextField t; 
    KeyBroker(JButton a, JTextField t) {
      this.a = a; 
      this.t = t; 
    } 
    public void keyPressed(KeyEvent e) { }
    public void keyReleased(KeyEvent e) { 
        a.setText(((new StringBuffer(t.getText())).reverse()).toString()); 
    }
    public void keyTyped(KeyEvent e) {
        System.out.println("Ouch!");
    }
}

class ButtonBroker implements ActionListener {
    JTextField t; 
    ButtonBroker(JTextField t) {
      this.t = t; 
    }
    public void actionPerformed(ActionEvent e) {
        System.out.println("Ha, ha!");
        t.setText(""); 
    }
}

Wed Sep 7
In class tomorrow we completely discuss the lab of Friday.

We should also at least briefly take a look at Homework Two.

Tue Sep 6
Here's a link to Spring 2005 A201, for those that need it.

Mon Sep 5
Lab Notes Two have been updated to give you a head start on the design stage.

Lecture Notes for the week will review the reading assignments and address the homework (which is based on them).

Sat-Sun Sep 3-4
Office hours schedule has been set as follows:
Adrian German dgerman LH201D 1-2pm MTWR
Chris Colvard cjcolvar LH201D 2-3:30pm TR
Jeremy Engle jtengle LH401A 10-11am and 2:30-3:30pm M
Minh Tang mhtang LH310 10-11:30am TR
Andrew Hinz anjhinz LH201D 2:30-4:30pm W
We are also available by appointment so please let us know.

Fri Sep 2
To extract the archive (and the picture) from labOne.jar:
jar xvf labOne.jar
After this you can run java Welcome.

Today in lab please submit your work before the end of the lab to OnCourse.

Thu Sep 1
Lecture notes for the week guide you through the first lab assignment.

Tomorrow in lab you will receive additional assistance.

We want to test the submission and grading procedures in OnCourse tomorrow.

Wed Aug 31
OnCourse CL set up to receive the first assignment (Lab One).

Let's see how it goes. Lecture notes explain the lab assignment.

Tue Aug 30
First lecture 4:00-5:15pm in GY 126 (Geology Building, Room 126).

Here's a campus map in case you need to look up other buildings too.

The current assignment to labs is (subject to change):

Chris Colvard cjcolvar SE045 08:00am-09:55am
Jeremy Engle jtengle SB221 10:10am-12:05pm
Minh Tang mhtang SE045 12:20pm-02:15pm
Andrew Hinz anjhinz BH108 02:30pm-04:25pm
Office hours will also be posted soon.

Mon Aug 29
Fall semester 2005 starts.

Here's how our class appears in OneStart (snapshot taken Aug. 24).


Updated by Adrian German for A202/A598 and I211