Announcements,
Homework, Lecture Outlines most recent
first
Monday 19-May
Grades have been officially submitted
Wednesday 7-May: Last day of classes
Announcements
- Class will be in 930 Gould Simpson today to finish Boggle (if needed
- Updated
grades (with programming project average corrected, handout was
3.3% low)
Monday 7-May
- New Added after class
- DiceTray stringFound() (Boggle Iteration 1)
due date extended to Wednesday at 4:00 pm
- Updated
grades (with programming project average corrected, handout was
3.3% low)
- Boggle need not give penalties for incorrect guesses (but you may make
it so)
- Test 2 stats
| Count |
57 |
| Average |
81 |
| Median |
85 |
| Max |
98 |
| Min |
30 |
- Virtual Reality tours added this week (check posters around the
department
- Kate will also be giving a Grad
Talk about getting into grad school , targeted towards freshman and
sophomores. RSVP to Kate so she orders enough pizza.
- Wednesday lecture in 930 GS
- If you have not finished Boggle, go to 930 GS with your partner to
work on Boggle
Homework
- Finish Boggle and email the zip file to your grader
Lecture
- Get test 2 from your section leader and also get your CSID from your
section leader (confidential), which you can also get it at https://www.cs.arizona.edu/computing/services/csid.html
- The grade sheet with your CSID does includes all grades except
Boggle Iteration 2
- These are not the final grades, but they are close
- If you see any errors, request corrections with documented evidence
by 1:00 pm Friday, 16-May (the end of the final exam). Otherwise your
grade record will be assumed accurate.
- three answers to
valueMappedToNthLargestKey
- Section leader evals
Friday 2-May
Announcements
- Test 2 will be handed back Monday with your List of grades as we have
them recorded
- Next Wednesday's lecture will be in 930 GS to work on Boggle (if you
need to)
- If you have completed Boggle, you don't need to attend.
Homework
- Complete Boggle by Wednesday 4:00 pm
Lecture
Wednesday 30-April
Announcements
- New: Test 2 will NOT have GUIs or Events
- Next lecture is Test 2, Friday, 2-May
- Test Review Session Thursday, 1-May 5:30 in 906 Gould Simpson
- You are invited to RSVP for a Virtual Reality tour: Details in cs_cave_announcement.pdf
through Friday.
- All grades will be available by next Monday (with Boggle 2 recorded only
as an estimate. which will be the average of projects 1..9
- You must provide Rick with documented evidence of errors before Friday May
16, 2008 1:00 pm (when the
final exam is scheduled--there is no final this
semester)
- Section this week meets again in 930 GS
- Attendance will not be taken
- Work on final project or use as a test review session
- Please do online evaluations for Rick and this course--but wait till
Monday if you can.
Homework
- If you have submitted DiceTray.stringFoundD(),
which is still due Wednesday night @ 10:00pm, Do not work on Boggle until after the test, instead study for Friday's
test (outline of topics below)
Lecture
- Hand Back Quizzes (Here are the stats so far. Remember, we drop
the lowest quiz)
| Q1 |
Q2 |
Q3 |
Q4 |
Q5 |
|
Test 1 |
Test 2 |
| 68 |
64 |
65 |
60 |
59 |
Count |
64 |
|
| 83.7 |
79.3 |
81.4 |
79.1 |
80.1 |
Average |
78.4 |
|
| 89 |
82 |
84 |
83 |
84.0 |
Median |
83 |
|
| 100 |
98 |
100 |
100 |
100 |
Max |
100 |
|
| 46 |
36 |
40 |
38 |
12 |
Min |
44 |
|
- Finish TimerDemo to update the JLabel in Color.RED or Color.ORANGE
- Review Iterators, which will be on the test
- Test 2 questions
- Recursion (like quiz 4)
- Binary Trees, specifically add 1 or 2 methods to OrderedMap (like
quiz 5)
- ArrayList, Iterators , Recursion, Binary trees,
java.util.Collections (like Practice Test 2, linked below)
- Study Materials for Test 2
- Chapters 10: Recursion
- Chapter 11: BinaryTrees
-
Appendix A: GUIs/Events
Six Four
presentations from presentations.htm
marked with Test 2
- Answers to Quiz 4 and Quiz 5 (handed out today)
- which are also by Rick's office: 727 Gould Simpson
- 127BPracticeQuiz4Spr08.pdf
and the Answers
- PracticeQuiz5.pdf with answers
at end
- Practice Test 2 (handed out today): Iterator java.util.Collections,
ArrayList<E>, File input,
GUI/ Event 127BPracticeTest2Spring2008.pdf with answers
at end
- RandomWriter and HashTables will not be on test
Monday 28-April
Announcements
- Almost everyone did this by 13-April, but if you didn't, FirstGUI
homework due Tuesday night at 10:00pm via WebBased
Turnin
- This is one of those 3 points activities
- Include two names on the file if you worked with another person,
which is okay
- Test 3: Friday, 2-May. Mostly recursion and binary trees (practice
test questions Wednesday, with a GUI/Event question)
- You are invited to RSVP for a Virtual Reality tour: Details in cs_cave_announcement.pdf
Homework
Lecture
- Another graphical user component
- JOptionPane.showMessageDialog(null,
"Any string\n you want");

- JPanel and another LayoutManager: GridLayout
- javax.swing.Timer
- All in TimerDemo.pdf (and linked
from CodeDemos page)
- Got all of it done except the time remaining is being printed--Need
to update the appropriate label with the Color.ORANGE (or
Color.RED)
Friday 25-April
Announcements
- Quiz 5: Friday, 25-April: Binary Trees and BSTs
Homework
- Work on the model part of Boggle
Lecture
- RandomWriterWithOrderedMap
- Your program may be slow because you process read through a very long
String (or StringBuilder) for every key, which could be
thousands of string traversals
- You can set up the OrderedMap object by only reading the file once
- Append all input to a StringBuilder
- For each seedlength part of the StringBuilder
- If the key does not exist
- create an empty ArrayList<Character> object, add
the follower (a single char) and put the mapping into your
OrderedHashMap
- otherwise the key already exists
- add the follower to the value (the ArrayList<Character>
object) associated with the key
- Consider a more intense RandomWriter
- Design with Boggle:
- Show me the methods! (there are no methods to implement, you
design this yourself)
- Imagine you could ask some object to do anything
- Give it a good name
- What arguments are needed (if any)
- What type does it return (if any)
- Imagine you could ask some object for any information
- Give it a good name
- What arguments are needed (if any)
- What type does it return
- Consider trying to write a console based Boggle game using SOP,
next, and hasNext
- Questions on the "Practice Quiz"?
- Take the quiz
Wednesday 23-April
Announcements
- NEW after class: Practice Quiz
Questions and answers
- NEW after
class: RandomWriterWithOrdredMap.java due date moved to
Monday, 28-April 10pm via web
based turnin (OrderedMap via WebCat is still due Wednesday
night @ 10:00 pm).
- One of your classmates took first prize in a national programming
contest http://www.cs.uiuc.edu/outreach/games4girls.php
Homework
- Finish Project 11: OrderedMap<K, V> and
RandomWriterWithOrderedMap
Lecture
- Finish HashMaps
- Demonstrate Java's HashMap class where we have a String key and an
ArrayList value
- Final Project:
- Has 2 iterations and turnins
- First via WebCat, Second (with the GUI) via WebBased
- Play Boggle
- Move to the part of the room with your Section Leader and complete
the form we hand out
- Turn this in before you leave (3pts)
Monday 21-April
Announcements
- Repeat: Quiz 5 (Binary Trees, BSTs) changed to Friday, 25-April
- Test 2 is still planned for Friday 2-May
- Repeat: The
final sections of 127B will be held in 930 Gould Simpson
- 24- or 25-April Work with
partner on final project
- Partners will be assigned
Wednesday
- Your partner must be from
your section
- 1- or 2-May: Work with partner on final project
Homework
- Finish Project 11: OrderedMap<K, V> and
RandomWriterWithOrderedMap
Lecture
- Demo RandomWritingWithArrayList
and different seed sizes
- start with seedlength = 1, then increase
- Demo RandomWritingWithOrderedMap
and different seed sizes
- take a look at the tree that would be built with
Alice likes icy olives
- HashMaps
Friday 18-April
Announcements
- Quiz 5 (Binary Trees, BSTs) changed to Friday, 25-April
- Test 2 is still planned for Friday 2-May
- The
final sections of 127B will be held in 930 Gould Simpson
- 24- or 25-April Work with
partner on final project
- 1- or 2-May: Work with partner on final project
Homework
- Work on Project 11: OrderedMap<K, V> and
RandomWriterWithOrderedMap
Lecture
- Consider the remove(E) algorithm to
remove a node from a BST
- You could use another algorithm if you
want to derive your own.
- Introduce the notion of RandomWriting with Joe Zachary's problem in RandomWriter.ppt
- Consider RandomWriter with
OurOrderedMap using a BST data structure
- Using this as the original:
"Alice likes icy olives", create an Map of Seed/List
mappings where the seed is a string and the value is a list of ALL
characters that follow that seed in the original text:
- Result (keys are in their natural
ordering as we are using a BST in the Map):
Size
of the tree (# of mappings):
17
Height
(maximum path length):
5
Text:
Alice likes icy olives
Seed Length (length of the String key): 2
Key -> Value, which is a list of characters (printed
sideways)
|
"y " [o]
"ve" [s]
"s " [i]
"ol" [i]
"li" [c, k, v]
"ke" [s]
"iv" [e]
"ik" [e]
"ic" [e, y]
"es" [ , ]
"e " [l]
"cy" [ ]
"ce" [ ]
"Al"
[i]
" o" [l]
" l" [i]
" i" [c]
|
|
Wednesday 16-April
Announcements
- Important: The
final three sections of 127B will be held in 930 Gould Simpson
- 17- or 18-April Work
with partner on "An Event Driven Program": AnEventDrivenGUI.doc
- 24- or 25-April Work with
partner on final project
- 1- or 2-May: Optional: Work with partner on final project
- Repeat: Optional: Use OneMethodForSaveGameTest.java
as a unit test with one method for testing GameTree save()
- You do NOT need to turn this in for full credit
- Repeat: Here is GameOf20GUI.java (optionally use this to see if your game works, just don't turn it in).
Homework
- Begin OrderedMap
- Note: the remove(E) algorithm will be discussed Friday, but you
should be able to do all other methods
Lecture
Monday 14-April
Announcements
Homework
- Finish Game of 20 Questions by Wednesday @ 10:00pm
Lecture
Friday 11-April
Announcements
Homework
- Work on Project 9: Game of 20 Questions
Lecture
- Demonstrate the Game of 20 Questions with Rick's GUI
- Binary Search
Trees
- implement insert
and find
Wednesday 9-April
Announcements
- Reminder: Current project (Game of 20 Questions ) is NOT due
tonight
Homework
- Work on Project 9: Game of 20 Questions
Lecture
- Continue with Expression Trees
- add postFix to return a textual view of the tree in postFix
- add inFix to return a textual view of the tree in inFix
- Write valueOf to evaluate the expression tree (only + and -
operators)
- add printSideways to show the structure of the tree (not ideal)
- Game of 20 Questions
- Demo with GameOf20GUI.java
- Write the save method at the very end; after everything else
is working
Monday 7-April
Announcements
- Reminder: Current project (Game of 20 Questions ) is NOT due
this week
Homework
Lecture
- Continue with Expression Trees
- Write postFix to return a textual view of the tree in postFix
- Write inFix to return a textual view of the tree in inFix
- Answer to 1C was wrong until 9:20 this morning
- Take Quiz
Friday 4-April
Announcements
Homework
- None (optionally begin Project 9)
Lecture
- Expression Trees
- Begin with the test to explain this new type: ExpressionTreeTest.java
- Load ExpTreeStart.java, which won't compile
- Write method build to
construct the tree recursively (use a method like this on the next
project)
- Write inFix to return a textual view of the tree in infix
notation (post fix if time permits)
- Play a game
- Introduce Project 9
Wednesday 2-April
Announcements
- Recursion Quiz 4
- Monday, 7-April
- Practice Quiz handout pdf
Homework
- Complete these 5 problems from the practice quiz with pencil and paper
and hand in at the beginning of your section this week 1a, 2a, 3a,
4a, 5a
Lecture
Monday 31-March
Announcements
- Short project 8 linked, due Thursday @ 8:00pm
- Recursion Quiz 4 will be Monday, 7-April
- Rich Saunders talk on the programming language Python
- 6:30 pm, Tuesday 1-April 906 Gould Simpson
- Free pizza in the 9th floor atrium
- Sponsored by the Student Chapter of the ACM
Homework
- Read first 12 pages of Chapter 11: Binary Trees, pages 189 .. 200
- Note: The tree traversals beginning on page 196 are another example
of backtracking
Lecture
- Turn in your hard copy solution of groupSum
- Discuss findTheExit algorithm (below) and Project 8
- Reading from an input file (sample code from page 116).
Scanner
keyboard = new Scanner(System.in);
String
fileName = keyboard.nextLine();
Scanner
inputFile = null;
try
{
// Throws exception if file
with the input name can not be found
inputFile = new Scanner(new
File(filename));
}
catch
(FileNotFoundException fnfe) {
System.out.println("File
not found: '" + fileName +
"'");
}
//
Treat scanner as a Scanner object with nextInt, hasNextLine, and nextLine
Friday 28-March
Announcements
- You are invited to CS picnic Saturday 4:00 pm at Himmel
Park (SW corner)
Homework
Lecture
- Two problem solving strategies: 1) Divide and Conquer 2)
Backtracking
- O(n log n) Quicksort
- There are two parts
- the split algorithm to make some progress towards sorting,
which is NOT recursive, and
- the recursive method that specifies which portion to sort
- Backtracking
- N queens
- Obstacle Course
- JavaBat problem
Algorithm
to escape from the starting point to the first exit found in the
obstacle course (or return false if there is no escape)
public
boolean findTheExit(int row, int column) {
boolean escaped = false;
if current row and column is a possibility (not blocked and not
tried) {
set current location to TRIED;
if current location is on the border, the mover is out so
set escaped = true
else {
let escaped = (RP1) success of escaping using the row below
if still not escaped
let escaped = (RP2) success of escaping using the column to the right
if still not escaped
let escaped = (RP3) success of escaping using the row above
if still not escaped
let escaped = (RP4) success of
escaping using the column to the left
}
if the mover was known to escape (escaped is true)
during this current method
let current location = PART_OF_PATH;
}
return escaped back to the caller, which is usually this very same
method
} // end tryThisWay
|
++ +++O+++++++++++++
+ O+ + ++ ++
+ OOO +++++ ++
+ OO++ ++++ + + ++
+ O+ + ++ +++ +
+ OOO SOO+ ++ + +
+++++O+ +O ++ +
+++++O+++O + + ++ +
+ OOOOO + + + +
+++++ + OO ++ +
++++++++++++++++++++
|
Wednesday
26-March
Announcements
- 127B: You are invited to CS picnic Saturday 4:00 pm at Himmel
Park (SW corner)
Homework
- Finish all 6 recursive methods
- binarySeach must be O(log n), -10 if it is not
Lecture
-
More recursive examples MoreRecursion.ppt
- String commas(long): commas(12345678) would print 12,345,678
- convert(int number, int base) Print a number in a different base
- in class: make it work for base 11..16
- Find max in array using a private helper method
- Begin to explain Quicksort, which sort arrays O(n log n)
- There are two parts
- the split algorithm to make some progress towards sorting,
which is NOT recursive, and
- the recursive method that specifies which portion to sort
Monday 24-March
Announcements
- There will be no quiz today
- Quiz 4 will be 7-April (only 5 quizzes, lowest still dropped)
Homework
- Read to end Chapter 10 Recursion, pages 174..188
- Recursion with arrays and linked structures.
Lecture
-
Continue with Simple
Recursion, begin at 10-16
- Infinite recursion
- Tail recursion
- Recursion with arrays
- Code demo: Sequential search
- Introduce project 6B: Three more recursive methods
- In-class
Wednesday 12-March
Announcements
- Go to 930 GS for section to complete the first 3 problems of next
project and turnin via WebCat
- If necessary, go to lab during Friday's lecture 1:00-1:50pm
Homework
- By 1:50 pm Friday turn in RecursionFun 1, 2, 3
from WebCat (if
Eclipse Submission is not working) :
- From Eclipse right click on the Project name you wish to zip up into
one file.
- Then select Export > General > Archive File > Next
- Browse to and name the archive file, PriorityList.zip for example.
- Click Finish.
- With your user name, password, and selecting the institution as
University of Arizona, login to WebCat: https://web-cat.cs.vt.edu/Web-CAT/WebObjects/Web-CAT.woa
- Click the submit tab (upper left corner) and follow the submission
instructions.
Lecture
Monday 10-March
Announcements
- This week will be different
- Section leaders introduce recursion Wednesday
- Go to 930 GS for section to complete the first 3 problems of next
project and turnin via WebCat
- If necessary, go to lab during Friday's lecture
Homework
- Read first 5 pages of Chapter 10 recursion, pages 169..173
Lecture
Friday 7-March
Announcements
- Test 1 Monday, 10-March
- All material, including USING ArrayList<E> , LinkedList<E>
and using Iterator<E> (there will be NO implementation of
Iterator<E>)
Homework
- Answers to the three quizzes handed out today.
- Practice quizzes are another resource of example test questions
- Practice Quiz 1 with answers MS-Word
or PDF
- Practice Quiz 2 with answers MS-Word
or PDF
- Practice Quiz 3 with answers MS-Word
or PDF
(combined 4 questions with in class)
Lecture
-
Questions from anonymous survey
- How does compareTo work? What is Comparable?
- Answer
- compareTo is a commonly used way for Java to compare any
two objects.
- compareTo is a binary operation that does NOT look like
one
- a.compareTo(b) < 0 is true when a < b
- a.compareTo(b) >= 0 is true when a > b
- a.compareTo(b) == 0 is true when a equals b and b
equals a
- The Comparable interface is a way to guarantee that two
objects can be compared to see if one is less than another
- What is Iterator?
- Difference between implements and extends?
- extends means you get most methods and instance variables
from the existing class that you extend. You usually add
instance variables, a constructor, and other methods
- implements means the class must implement all methods of the
interface
- When do you cast?
- When a type is not the type expected by the compiler; mostly
when using Object
- example: compareTo argument must be a Comparable; need
to cast Object to Comparable
- an assignment expects a certain type: need to Cast
Object to the expected type
- If this is part of a method, you will not loose points
on the test
- More examples of Stacks
- Answer: We have seen several applications of stacks, review
them in the slides, book, or section handout. Stacks are last
in, first out (LIFO)
- Evaluating postfix expressions
- Checking balanced symbols
- Converting infix expressions to postfix
- Expanding out into new MineSweeper squares until mines
or squares are next to mines
- More examples of Queues
- We have only seen the operations, no applications. Queues
are FIFO, like a waiting line. Consider these applications
- A queue maintains print job requests to process them in
FIFO order
- A queue on a router maintains packets to push them to
their destination while receiving others, packets are
processed FIFO
- Same for test message packets or cell phone audio
packets on the computers
- A waiting line simulation to determine the average wait
times of customers with 1, 2, or 3 cashiers.
- A Jukebox plays songs in FIFO order
- Demonstrate this and show code
Monday 3-March
Announcements
- Test 1 Monday, 10-March
- Iterators not on quiz, but will be on the test
Homework
Lecture
-
Make LinkedSet "iterable"
- Quiz 3, begin no later than 1:25
Wednesday 5-March
Announcements
- Repeat: Test 1 Monday, 10-March
- All material, including today's List<E>, ArrayList<E>,
and LinkedList<E>
- Test review session
- Thursday 7-March 5:30 pm to 7:00 pm
- 906 Gould Simpson
- Quiz Stats
| |
Quiz 1 |
Quiz 2 |
Quiz 3 |
| Count |
68 |
64 |
65 |
| Average |
41.8 |
39.7 |
40.7 |
| Median |
44.5 |
41.0 |
42.0 |
| Max |
50 |
49 |
50 |
| Min |
23 |
18 |
20 |
Homework
- Study for Monday's test. Use the 3 practice quizzes and the three
quizzes
- Practice Quiz 1 with answers MS-Word
or PDF
- Practice Quiz 2 with answers MS-Word
or PDF
- Practice Quiz 3 with answers MS-Word
or PDF
(combined 4 questions with in class)
Lecture
-
Introduce Java Collections Framework
2..13
-
What is still unclear?
- Anonymously, on a piece of paper, tell us what is still muddy or
needs more examples
- This should help us with the review session and Friday's test preview
part of lecture.
- Turn this in upside down on the table as you leave
Monday 3-March
Announcements
- Test 1 Monday, 10-March
- Iterators not on quiz, but will be on the test
Homework
Lecture
-
Make LinkedSet "iterable"
- Quiz 3, begin no later than 1:25
Friday 29-Feb
Announcements
- Repeating:
- An archived (zip file) Eclipse project with
MineSweeperGUI and a folder of pictures MineSweep.zip.
After downloading this zip file,
- From Eclipse select
- File > Import > Existing
Projects into Workspace > Next
- Check Select archive file
- Click Browse
- Use you explorer window or Finder to
and open the zip file you just downloaded
- Click Finish
Homework
- Work on MineSweeper
- Study for quiz
- From Wednesday, practice quiz question FastQueue<E> with
an answer pdf
- Three more questions on Stacks and Queues pdf
Lecture
- Writing your own exceptions
- Write a class that extends RuntimeException
(see EmptyQueueException.java on Code
Demos Page)
- Add Iterator<E> iterator()
to ArraySet<E> (will not be
linked since it is a project)
- in class:
Make LinkedSet "iterable"
Wednesday 27-Feb
Announcements
- NEW Added
after class
- Practice quiz question FastQueue<E> with
an answer pdf
- An archived (zip file) Eclipse project with
MineSweeperGUI and a folder of pictures MineSweep.zip.
After downloading this zip file,
- From Eclipse select
- File > Import > Existing
Projects into Workspace > Next
- Check Select archive file
- Click Browse
- Use you explorer window or Finder to
and open the zip file you just downloaded
- Click Finish
- MineSweeper now WebCatted
- You may import this Eclipse project, copy and paste your MineSweeper
class and run the GUI.
Homework
Lecture
- Demo the MineSweeper project with the GUI
- Consider MinesweeperClearingTest.java
Example unit test (also on code demos page)
X X X X
2 3 3 2
0
0
1 1
0 0
1 X
Writing your own exceptions
- In-class: Develop FastQueue<E> implements OurQueue<E>
- Use two external references: front
and back
- All methods must be O(1)
Monday 25-Feb
Announcements
- First part due tonight by 10:00pm: LinkedStack only (may
have GamePiece or GameSquare)
- Second part will be Webcatted Tuesday 26-Feb
- Quiz 3 in one week
- Test 1 in two weeks
Homework
Lecture
- A few more things about MineSweeper (see projects page)
- Your class needs to add two constructors, see project from projects
page
- Should have a 2D array
of GamePiece or Square objects to store information about one
place that is clicked: has mine, how many mines around the square,
is the square visible, flagged, checked? ... as suggested Friday
- Begin Queues
9-24.. 9-42
Friday 22-Feb
Announcements
- May have missed fail(); in
section
- To ensure a method throws an exception, add fail();
after the method that should have
- Example code has been added to Part 1 of Minesweeper for fail has
been added here
- Next project in 2 parts (that mean you will have 2 weeks)
- Both are now linked from the projects page
- First part due Monday 25-Feb by 10:00pm: LinkedStack only (may
have GamePiece)
- First part due Monday 25-Feb by 10:00pm: MineSweeper implement
MineSweeperModel
Homework
- Turn in LinkedStack by 10:00 p.m. Monday 25-Feb (published now on
WebCat)
- Once you get 100%, Work on MineSweeper (not
published until Tuesday, 26-Feb)
Lecture
- Introduce Project 5: MineSweeper, Part 1 (see projects
page)
- Discuss algorithm for the click method and consider a new type to
help
- Suggestion: Do not have an 2D array of Char, have a 2D array
of GamePiece objects
- You should be able to push and pop GamePiece objects on your
LinkedStack<E>
- Take notes so you can develop your own GamePiece type
Wednesday 20-Feb
Announcements
- Next project in 2 parts (that mean you will have 2 weeks)
- First part due Monday 25-Feb by 10:00pm
Homework
- Read about Exceptions before Section
- Begin Part 1 of Project 5: LinkedStack<E> implements OurStack<E>
Lecture
- Stacks
- Introduce Project 5: MineSweeper, Part 1 (see projects
page)
Monday 18-Feb
Announcements
Homework
- Read about Stacks in Chapter 9, pages 152,,159
Lecture
- Why linked lists?
- Can conserve memory, as needed
- When n is large, resizing array can be sloe and memory consuming
- Some algorithms run faster
- Easier to implement some collections (like stack and queue)
- Good warmup for binary trees
- Practice Quiz answers,
any questions?
- Quiz 2
Friday 15-Feb
Announcements
- Quiz 2 Monday, 18-Feb
- Quiz begins at 10:25 and ends at 10:50
Homework
- Complete this practice quiz before Monday's class
Lecture
- Show another way to addFirst
- Implement the remove method in LinkedBag
- Consider special cases of when first must change
- Consider adding in order (via pictures)
- Questions on Project 4? (projects page).
Here's what's different
- You must use a singly linked structure
- Big O requirements
- The class heading removes the need to cast to Comparable
- In class: begin the practice quiz. Turn it in just before the
quiz.
Wednesday 13-Feb
Announcements
- Quiz 2 Monday, 18-Feb
- Practice Quiz will be posted Friday
Homework
- Read about linked structures in Chapter 8: List with a Linked Structure
- pages 1..18 (hard copy) or 127..144 (on line)
Lecture
- Begin Linked Structures
- Introduce Project 4 (projects page).
Here's what's different
- You must use a singly linked structure
- Big O requirements
- The class heading removes the need to cast to Comparable
Monday 11-Feb
Announcements
- ACM Meeting Tuesday, 6:00pm. 9th floor atrium
- Quiz 2 : Monday 18-Feb
Homework
- Read about linked structures in Chapter 8: List with a Linked Structure
- pages 1..18 (hard copy) or 127..144 (on line)
Lecture
- Reminder: Project 3 has four methods that need an upper bound (see grading
criteria at the end of ArraySet<E>)
- In class Object, Autoboxing,
add a method to a generic collection
- Begin Linked Structures
Friday 8-Feb
Announcements
- Project 3 has four methods that need an upper bound (see grading
criteria at the end of ArraySet<E>)
Homework
- To help with the current project, Read all of chapter 7
- A List interface
- A class with an array instance variables to implement that interface
- Array shifting during add and remove
Lecture
- Continue with Collection
Considerations, 22..34
- Demo sorting
- Selection sort with people
- Selection sort an array of BankAccounts without and with
Comparable
- Change Comparable
- In class Object, Autoboxing,
add a method to a generic collection
Wednesday 6-Feb
Announcements
- Project 3 posted: ArraySet<E> implements OrderedSet<E>
Homework
Lecture
Monday 4-Feb
Announcements
- Next project will be assigned Wednesday
Homework
- Read about ADTs, Data Structures and Java Collections in Chapter 6
Lecture
Quiz 1 is Monday, 4-Feb
- Up to 5 minutes to answer questions
- Quiz to begin at 1:05
- Quiz will take approximately 25 minutes
- time announcements will be made at 10, 5, and 1 minutes
- About 20 minutes of lecture
- Implement a simple generic collection with Object[]
Friday 1-Feb
Announcements
- Due dates for PiggyBank and GameOfLife are due tonight by 10:00pm
- Quiz 1 is Monday, 4-Feb
- up to 5 minutes to answer questions
- Quiz to begin at 1:05
- Quiz will take approximately 25 minutes
- time announcements will be made at 10, 5, and 1 minutes
- We will have about 20 minutes of lecture
- Topics
- JUnit test with Assertions
- A method that does 1-D array processing
- A method in a class that does 2-D array processing
- See practice quiz below
Homework
Lecture
Wednesday 30-Jan
Announcements
- WebCat login has been done since last night. You can Submit from
Eclipse, but you can't login and change your password or use the file
Upload option, therefore
- GameOfLife project extended until Friday 1-Feb by 10:00 p.m.
Homework
- Read to end of Chapter 5: Algorithm Analysis
- If necessary, Work on Project 2: Game of
life
Lecture
Monday 28-Jan
Announcements
Homework
- Work on Project 2: Game of life
- Read first 10 pages of Chapter 5:
Algorithm Analysis
- On-line version: pages 79..87
- Bookstore version: Chapter 5 pages 1..9, stop at 5.4 Search
Algorithms
Lecture
- Answer this in-class together
- Add the WebCat Submit plugin to Eclipse (or at least try)
- Demo WebCat by submitting what Rick provided (probably a poor
score)
- Questions Project 2: Game of Life?
- What is javadoc? Why do we have comments with /** and @version
and @author and @param
- Because the PMS Style Checker complains
- Submit the same file with no JavaDoc
- More importantly, this helps when we use other people's
"java-doxed" code
- Show Java's API
- What if you are using String substring, demo in Eclipse
- Why do I not get 100% Code coverage?
- You may not be calling toString. Feel free to Test toString with
a test method like this:
@Test
public void
testToString() {
GameOfLife society =
new
GameOfLife(2, 10);
String expected =
"..........\n..........\n";
assertEquals(expected, society.toString());
society.growCellAt(0, 0);
society.growCellAt(0, 4);
society.growCellAt(0, 8);
society.growCellAt(1, 2);
society.growCellAt(1, 6);
assertEquals(
"O...O...O.\n..O...O...\n",
society.toString());
}
Friday 25-Jan
Announcements
- Project 2 posted on projects page
- If you can not submit to WebCat, send Rick an email immediately or tell
Rick at the end of class
- The PiggyBank section
activity can still be turned into WebCat by Monday 12:45 (not a second
later)
- In C Sc 127B, you are expected to complete programming projects
individually,
- See syllabus section that begins with Academic
Integrity and Penalties:
Homework
- Work on Project 2: Game of life
Lecture
- Code demo: Matrix, a class with a 2D array (code to be linked on the code
demos page)
- constructor takes a 2D array of doubles
- get(int, int) returns the value at a specified row and column
- add(Matrix) adds the Matrix argument to this Matrix
- Discuss Project 2: Game of Life
- in-class
Wednesday 23-Jan
Announcements
- See 18-Jan below if you have a hard copy
of the book
Homework
- Turnin Project 1 by 10:00 p.m. tonight
Lecture
- TDD BankAccount (review Java classes while providing another
examples of TDD)
- In-class: Add withdraw that only
withdraws if there is enough money in the account. Return true or false
Monday 18-Jan 3:00 pm
Announcements
- MLK Day, no classes
- If you are using the printed book (these changes have been made to the
online version)
- on page 14 of Chapter 4, change getTimesPlayedToday
to
songsPlayedToday
in two places: 1) very first
word on the page and 2) the method name
-
on page 14, Change
for (int i = 0; i < datesPlayed.size(); i++) {
if ((sameDay(today,
datesPlayed.[i])
result++;
}
to this
for (int i = 0; i < n; i++)
{ // 1) replace datesPlayed.size()
with n
if ((sameDay(today,
datesPlayed[i]) // 2) remove the .
result++;
}
-
on page 15, Change if
(today.sameDay(mostRecentDatePlayed))
-
to this: if
(sameDay(today, mostRecentDatePlayed))
Friday 18-Jan
Announcements
- Project 1 posted. Due next Wednesday, 23-Jan at
110:00 p.m.
- Lab hours will be posted to the right by Tuesday, when they begin
- Josh will be in the 228 Gould Simpson on Monday, 21-Jan (Martin
Luther King Day) from 1:00 to 3:00 pm (one time
only) to help with project 1, Eclipse, and unit tests with JUnit
- See lab
hours link to the left for section leader lab hours on Tuesday
22-Jan and Wednesday 23-Jan
Homework
- Optional: Work through this short
tutorial on using Eclipse for the first time
- Read pages 1..7 in Chapter 2: Objects, JUnit
- Optional: Skim the rest of chapter 2 and all of chapter 3, you should
already know this
- Complete Project 1: Learn TDD in Chapter 4 by doing it
Lecture
- Demo Eclipse and unit testing with Eclipse
Monday 16-Jan
Announcements
-
The
textbook for this course is available
-
or
Free
online
Section
will be held this week all in 942 Gould Simpson on
Thursday and Friday
Homework
- Get your CS computer account ASAP
- Skim Chapter 1 (you should know all of this) and answer
self-checks--Chapters linked from ricksBook
Lecture