CPSC 124 Introduction to Programming Fall 2010

CPSC 124 Syllabus

Readings are to be done for the class period where they are listed. Warmups are due by midnight before the class for which they are listed.

Optional readings are more advanced or extra material for those who are curious or want to go beyond the basics - you are encouraged to check them out, but they will not be addressed in class.

Dates for things in light gray are tenative and may shift slightly.

 Assignments

Week 1: 8/30-9/3

Topics: course introduction; the mental landscape; basic building blocks

     

Mon        

Wed Reading:

Important: If you already have an account on the math/CS Linux computers, make sure you remember your password and can log in. If not, send an email with your username to Scotty Orr (scottyorr@hws.edu) by Wednesday.

warmup
(on Blackboard)
due Tue 11:59pm
   

Thu Reading: Eck sections 2.1, 2.6.2 (read 2.6.2 just to get a sense of the process - the lab will introduce the particular tools and directory setup)   lab #1
Introduction to Linux and Java

due Thu 9/9
at the start of lab
 

Fri Reading: Eck sections 2.1 (review), 2.2-2.4.3 (new) [reading guide]

In Class:

warmup
(on Blackboard)
due Thu 11:59pm
 

Week 2: 9/6-9/10

Topics: basic building blocks; algorithms

   

Mon Reading: Eck sections 2.5.1-2.5.2, 2.5.6-2.5.8 (don't worry about the relational, boolean, or conditional operators in section 2.5.8) [reading guide]

In Class:

warmup
(on Blackboard)
due Sun 11:59pm
 

Wed In Class: 5-minute syntax quiz on variable declarations, assignment statements, expressions, output. Expect questions of the following types:
  • Declare a variable called length that will hold an integer.
  • Store the value 42 in the variable size.
  • Write an expression to add 10 to the result of dividing 8 by 2. (and then possibly print the result or store it in a variable)
  • Print the message Hello world!. (or the value of a variable or expression)

In Class:

   

Thu Reading: Eck section 3.2.3   lab #2
Names and Things

due Thu 9/16
at the start of lab
 

Fri Reading: Eck sections 2.5.3-2.5.4, 2.5.8, 3.1-3.2 [reading guide] warmup
(on Blackboard)
due Thu 11:59pm
 

Week 3: 9/13-9/17

Topics: loops and conditionals

   

Mon Reading: Eck sections 3.3.1, 3.3.3, 3.4.1-3.4.2 (section 3.3.2 is optional) [reading guide]

In Class:

  • Warmup5a.java (while loops and for loops)
  • Printer.java (going from pseudocode to code, including loop development questions to ask)
warmup
(on Blackboard)
due Sun 11:59pm
 

Wed Reading: Eck section 3.4.3 (section 3.4.4 is optional) [reading guide]

In Class: 5-minute syntax quiz on for loops. Expect questions of the form:

  • Write a for loop to repeat the statement System.out.println(n); so that the numbers from 1 to 10 get printed.

(In other words, you'll be given the statements for the main task that is to be repeated; your job is to fill in the rest of the loop structure to achieve the desired result.)

In Class:

  • syntax quiz (with solutions)
  • Sum.java (going from pseudocode to code, including loop development questions to ask)
warmup
(on Blackboard)
due Tue 11:59pm
 

Thu     lab #3
Control I

due Thu 9/23
at the start of lab
 

Fri Reading: Eck section 3.5 (section 3.6 is optional) [reading guide]

In Class:

warmup
(on Blackboard)
due Thu 11:59pm

Week 4: 9/20-9/24

Topics: algorithms, loops, and conditionals; arrays

   

Mon In Class:    

Wed In Class: 5-minute syntax quiz on if statements. Expect questions which ask you to translate pseudocode, such as:
  • if x is greater than 10,
      print "big!"
    otherwise
      print "small!"
    
  • if x is between 0 and 100,
      if x is less than or equal to 50 or greater than 75,
        print "A"
    else if x is between 101 and 200,
      print "B"
    

In Class:

   

Thu     lab #4
Control II

due Thu 9/30
at the start of lab
 

Fri Reading: Eck sections 7.1, 7.2.1, 7.2.4 (section 7.2.2 is optional) [reading guide]

In Class:

warmup
(on Blackboard)
due Thu 11:59pm

Week 5: 9/27-10/1

Topics: arrays; exceptions

   

Mon In Class:    

Wed Reading: Eck sections 7.5.1-7.5.2 (section 7.5.3 is optional - it provides an example of 2D arrays, but it uses classes and subroutines, which we haven't covered yet) [reading guide]

In Class: 5-minute syntax quiz on (1D) arrays. Expect questions of the following types:

  • Declare a variable called numbers that will hold an array of integers, and set up the array with 10 compartments.
  • Print the number of slots in the array numbers.
  • Store the value 42 in the third slot of the array numbers.
  • Print out (initialize, add 5 to, etc) the values in each slot of the array numbers.

In Class:

warmup
(on Blackboard)
due Tue 11:59pm
 

Thu     lab #5
Arrays

due Thu 10/7
at the start of lab
 

Fri Reading: Eck section 3.7 [reading guide]

In Class:

warmup
(on Blackboard)
due Thu 11:59pm

Week 6: 10/4-10/8

Topics: subroutines

   

Mon Reading: Eck sections 4.1-4.2.3 [reading guide]

In Class:

warmup
(on Blackboard)
due Sun 11:59pm
 

Wed Reading: Eck sections 4.3.1-4.3.4 [reading guide]

In Class:

warmup
(on Blackboard)
due Tue 11:59pm
 

Thu       project #1
Battleship

pseudocode meeting
due Tue 10/19

Fri
exam #1
Fri 10/8 in class
   

Week 7: 10/11-10/15

Topics: subroutines

   

Mon fall break
(no class)

Wed In Class:    

Thu     lab #6
Subroutines

due Thu 10/21
at the start of lab

Fri Reading: Eck section 4.4 [reading guide]

In Class:

warmup
(on Blackboard)
due Thu 11:59pm

Week 8: 10/18-10/22

Topics: subroutines; program design with subroutines

 

Mon In Class: 5-minute syntax quiz on subroutines and functions. Expect questions of the following types:
  • Write the header (body not needed) for a function to compute the maximum of two integers: it should take two integers as parameters and return the larger of the two.
  • Write statement(s) to print the larger of 10 and the value stored in the variable x. Use your maximum function to determine the larger number.

In Class:

 

Wed Reading: Eck sections 4.3.5, 4.5.1, 4.5.4, 4.6 [reading guide]

In Class:

  • Warmup14.java (fully-commented version of getRandom)
  • SumStats.java (using subroutines to manage complexity when developing a program)
warmup
(on Blackboard)
due Tue 11:59pm
project #1
Battleship

due Thu 10/28
at the start of lab

Thu     lab #7
Functions

due Thu 10/28
at the start of lab

Fri Reading: Eck section 4.7 [reading guide]

In Class:

warmup
(on Blackboard)
due Thu 11:59pm

Week 9: 10/25-10/29

Topics: objects and classes

 

Mon Reading: "Objects" handout posted on Blackboard (under "Course Documents"), Eck sections 1.5, 5.4.1, 5.4.3 [reading guide] warmup
(on Blackboard)
due Sun 11:59pm

Wed Reading: Eck sections 5.1-5.2, 5.4 (5.4.2 is new; review 5.4.1, 5.4.3) [reading guide]

In Class:

warmup
(on Blackboard)
due Tue 11:59pm

Thu     lab #8
Using Objects

due Thu 11/4
at the start of lab
 

Fri In Class:  

Week 10: 11/1-11/5

Topics: objects and classes

   

Mon In Class:    

Wed In Class: 5-minute syntax quiz on objects and classes. Expect questions of the following types:
  • Write a complete class called Dice to represent a single die. Your class should have:
    • an instance variable holding the die's current value
    • an instance variable holding the number of sides
    • a constructor which takes the number of sides as a parameter and initializes the instance variables accordingly (set the current value to a random number between 1 and the number of sides)
    • a getter which returns the die's current value
    • a getter which returns the number of sides
    • a roll method which rolls the die, updating the current value to a new random value between 1 and the number of sides
  • Write Java statement(s) to create a Dice object with 10 sides, roll it, and print the current value.

In Class:

 

Thu     lab #9
Pong

due Thu 11/11
at the start of lab
 

Fri Reading: Eck section 5.3.4 [reading guide]

In Class:

warmup
(on Blackboard)
due Thu 11:59pm
 

Week 11: 11/8-11/12

Topics: inheritance

   

Mon Reading: Eck section 5.5 [reading guide]

In Class:

warmup
(on Blackboard)
due Sun 11:59pm
 

Wed In Class:    

Thu       project #2
Pac-Man

design meeting
due Wed 11/17

Fri
exam #2
Fri 11/12 in class
   

Week 12: 11/15-11/19

Topics: inheritance; GUI programming

   

Mon In Class:    

Wed Reading: Eck sections 5.6, 5.7.1 [reading guide]

In Class: 5-minute syntax quiz on inheritance. Expect questions of the following types:

  • Write a complete class GraphicalDice which is a subclass of Dice (see the example questions for the last syntax quiz for a description of Dice). Your class should have:
    • instance variables holding the position where the die is to be drawn
    • a constructor which takes the number of sides and the position of the die as parameters and initializes the instance variables accordingly
    • a constructor which takes the position of the die as parameters and creates a 6-sided die
    • a paint method which draws the die's current value
    • a roll method which calls Dice's roll method to roll the die and then paints the die with its new value
  • Write Java statement(s) to create a GraphicalDice object with 10 sides in the position (100,200), roll it, paint it on the screen, and print the current value.

In Class:

warmup
(on Blackboard)
due Tue 11:59pm
 

Thu     lab #10
Rabbit Hunt

due Thu 12/2
at the start of lab
project #2
Pac-Man

due Thu 12/2
at the start of lab

Fri Reading: Eck sections 1.6, 6.1, 6.3, 6.6, 6.7.1 [reading guide]; the rest of section 6.7 is optional

In Class:

warmup
(on Blackboard)
due Thu 11:59pm

Week 13: 11/22-11/26

Topics: GUI programming

 

Mon In Class:

More Information on GUIs:

 

Wed Thanksgiving break
(no class)

Thu

Fri

Week 14: 11/29-12/3

Topics: data structures

 

Mon Reading: Eck sections 7.3.1-7.3.4 [reading guide]

In Class:

no warmup
(but do the reading anyway!)

Wed In Class:  

Thu     lab #11
Partially-Full and Dynamic Arrays

due Thu 12/9
at the start of lab
project #3
Tic-Tac-Toe

due Tue 12/14
at 11:30am

Fri In Class: 5-minute syntax quiz on using ArrayLists. Expect questions asking you to write statement(s) for tasks like the following:
  • Add the necessary import statement to a program in order to use ArrayList.
  • Declare a variable to hold a reference to an ArrayList of doubles.
  • Create a new ArrayList of doubles object.
  • Insert the value 4.2 into an ArrayList at the end or at position 2.
  • Remove the value 4.2 from the ArrayList, or remove the element at position 2.
  • Retrieve and print the element at position 2.
  • Print out the number of elements in an ArrayList.

A section of the ArrayList API will be provided for you for reference.

In Class:

 

Week 15: 12/6-12/10

Topics: GUI programming

 

Mon Reading: review Eck sections 1.6, 6.1, 6.3, 6.6, 6.7.1 [reading guide]

In Class:

no warmup

Wed Reading: Eck sections 6.4.1-6.4.4, 6.5.4 [reading guide]; the rest of section 6.5 is optional

In Class:

warmup
(on Blackboard)
due Tue 11:59pm

Thu      

Fri In Class:    

Reading Period: 12/11-12/13

   

Sat    

Sun    

Mon    

Exams: 12/14-12/17

   

Tue
exam #3
Tue 12/14 8:30-11:30am
end-of-semester deadline
no work accepted after 12/14 11:30am

Wed      

Thu      

Fri      

Valid HTML 4.01!