Announcements, Homework, Lecture Outlines

Wednesday 7-May: Last day of classes

Announcements

For those not taking the final exam, Use 228 Gould Simpson for lecture today, not 930, to work on Boggle (if necessary)
Boggle Iteration 2 deadline extended until 4:00 pm Wednesday, 7-May

Homework

Finish Boggle and/or study for final 

Lecture

Final Exam Review Sheet
Use the previous three tests as the the practice final
Practice Test One and Answers
Practice Test Two  and  Answers 
Practice Test Three with Answers at end

Monday 5-May

Announcements

NEW Added After Class:
Boggle need not give penalties for incorrect guesses (but you may make it so)
Boggle Iteration 2 deadline extended until 4:00 pm Wednesday
Test stats:
Test 1 Test 2 Test 3
67 59 58 Count
86 82 76 Median
82.6 79.6 74.9 Average
98 100 90 Max 
30 43 52 Min
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.
Optional Final Exam: Friday, 9-May 11:00am - 1:00 pm in our usual lecture hall.
Will be comprehensive
Will replace your lowest test score (unless the final is lower than all 3 tests)
Wednesday:
If you are taking the final exam, attend lecture for thee (one and only final exam review schedule
If you are not taking the final exam and have not finished Boggle, go to 930 GS to work on Boggle

Homework

Finish Boggle and email the zip file to your grader
If taking the final, gather three practice tests and the three tests 

Lecture

Get test 3 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 may be used to determine if you should take the final
If you see any errors, request corrections with documented evidence by 1:00 pm Friday, 9-May (the end of the final exam). Otherwise your record will be assumed accurate.
one answer to bottomLevelFilled
Section leader evals

 

Friday 2-May

Test 3

 

Wednesday 30-April

Announcements

Test 3: Friday, 2-May.  Mostly recursion and binary trees, Also ArrayList and iterators
Practice test with answers at end
MS-Word  or  pdf
Test 3 Review Session, Thursday at 5:00pm in 701 GS
Reminder: BST remove was due last night
Complete this before the test for full credit
It is worth four 3-point activities and BSTs are on the test
Attendance will not be taken in section this week
We will have section this week (attendance not taken) for you to work on projects or get answers to questions on the practice test
You are invited to RSVP for a Virtual Reality tour: Details in cs_cave_announcement.pdf

Homework

Do not work on Boggle until after Friday's test, study for Friday's test.  

Lecture

Code Demo: another GUI and an Event (these topics are not on test 3, but will be on the optional final)
Handout at end of practice test  AnEventDrivenGUI2.pdf
Needed for Boggle:
JFrame, JTextArea
Study Material for Test 3
Chapters 10 (Recursion) and 11 (BinaryTrees)  
Code Demos for Test 3  (no GUIs/Events)
Four Powerpoint Presentations 
Chapter 10 Recursion
10MoreRecursion,ppt more algorithms plus QuickSort
Chapter 11 Binary Trees
An introduction to Java's Collection Framework  
Check question 27 (Iterators) and 28 (file input, the familiar scanner)

Monday 28-April

Announcements

BST remove due tonight at 9:55pm (not am
This is worth 4 in-class activities
Test 3: Friday, 2-May.  Mostly recursion and binary trees (practice test available Wednesday)
You are invited to RSVP for a Virtual Reality tour: Details in cs_cave_announcement.pdf

Homework

Work on Boggle

Lecture

The Maņana Principle mentioned a few time this semester means : I'll use methods and perhaps a new type that will be available tomorrow 
This little principle will not be on the test
Extend a class to get many methods with no work (reuse again as in ArrayList<E>) and observe polymorphism used to have a button click do anything you want the computer to do.  The example is GUIs and Events GUIsEvents.ppt

Friday 25-April

Announcements

Quiz today,  test 3: next Friday, 2-May

Homework

Read Boggle specs for Iteration 2: The View
Optional Read about GUI and Events in Appendix A of Rick's Book
We will do more GUIs and Events next Monday, so you need not begin Iteration 2 yet

Lecture

Introduction to Java's Collection Framework
Hint: ArrayList and a Collections method may be useful in the Boggle model
Design with Boggle. The Model 
Show me the methods!  (not this time)
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
In class: Write a console based app of Boggle using the Maņana Principle (I'll use methods (and perhaps a new type) that will be available tomorrow)

 

Wednesday 23-April

Announcements

For the remainder of the semester, section will be held in the lab: 228 GS (Mark's 1:00 pm section) or 930 GS (all other sections)
Final Project will be done in teams of 2
Partner should be in your section (one person can switch times for the final two sections).
We will record partners during lecture and your section today or tomorrow.

Homework

BST remove due Monday, 9:50 am

Lecture

Discuss algorithm for BST remove
Begin final project
Split into sections (the 4 corners)
Find a partner in your section
Complete the questions and turn in to your (or your partner's section leader

 

Monday 21-April

Announcements

Final two sections will be held in 228 GS (Mark's 1:00 pm section) or 930 GS (all other sections)
You will find a partner for your final project (presented Wednesday) from your section 

Homework

Work on Project 10: Game of 20 Questions

Lecture

Demo writing to an output file (sample code at end of project spec.
We could save expression trees
Binary Search Trees

Friday 18-April

Announcements

GameOf20 project has been WebCatted
Do not submit to 127B (we are almost caught up to 127B and two instances appear when you submit) 

Homework

Work on Project 10: Game of 20 Questions
do saveGame last

Lecture

Continue with Expression Trees
add printSideways to return the structure of the tree (indenting nodes at levels > 0 )

@Test 
public
void testSidways() {

  ExpressionTree et3 = new ExpressionTree("+ - 5 4 2");

  System.out.println(et3.sideways());

  assertEquals("   2\n+\n      4\n   -\n      5\n", et3.sideways());

}

add postFix to return a textual view of the tree in postFix 
Write valueOf to evaluate the expression tree (only + and - operators)
allow / and %
Game of 20 Questions
Let's write a test method now (to be posted) with an input file (shown in this file) TestAll_GameOf20.java
Demo writing to an output file (see code at end of project, we could save expression trees, should we?)
Demo with GameOf20GUI.java, which is also linked from the project
Note: Write the save method at the very end; after everything else is working
You may use OneMethodForSaveGameTest.java that writes the file anew for each test so the test pass the 2nd time (after the file grows and is tested, the 2nd test rewrite the fie to it's original test passing state)

 

 

Wednesday 16-April

Announcements

Project 10 now Linked

Homework

Begin Project 10

Lecture

Implement ExpressionTree that builds a tree from an prefix expression (a thing to do first with the current project, and very similar) 
Play a game to introduce the current project

 

Monday 14-April

Announcements

None

Homework

Work on Project 8: ObstacleCourse
Optional: Run it with ObstacleCourseGUI.java  in a separate project

Lecture

Continue Binary Trees  11-15 .. 11-18
Implement BinaryTreeOfStrings with
hardCodeATree()  // build a binary tree
size()  // return the number of elements in the tree (no insert or size++ yet) 
preOrder()   // return a string with all elements as visited in pre order  (root first)
inOrder()   // return a string with all elements as visited in in order  (root middle)
postOrder() // return a string with all elements as visited in post order  (root last)
vowels() // return the number of vowels in a binaryTreeOfStrings


Friday 11-April

Announcements

None

Homework

Work on Project 8: Obstacle Course
Get the GUI here also ObstacleCourseGUI.java

Lecture

Demonstrate Obstacle Course
Begin Binary Trees 

 

 

Wednesday 9-April

Announcements

Project 9 Linked, due next Tuesday

Homework

Read first 11 pages of Chapter 11: Binary Trees (pages 189..199 online)

Lecture

Demonstrate Quicksort that uses recursion to provide a divide and conquer approach to sorting
QuickSortTest.java
Backtracking: another problem solving strategy that can be implemented with recursion
Sudoku
N Queens
Escape the obstacle course (the new project)
 

 

Monday 7-April

Announcements

Project 8 Due Tuesday night

Homework

Work on Project 8: RecursionFun

Lecture

Begin at 10MoreRecursion 10B-11
Change convert(int, int) from Friday  to allow bases 2..16 where 10 is A and 15 is E
Another recursion example: ways to climb a ladder (or stairs)
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
 

Friday 4-April

Announcements

Project 8 complete (added problem 6) and Webcatted

Homework

Work on Project 8: RecursionFun

Lecture

More recursion examples 
Convert integers to different bases 2..10
Array processing with recursion
boolean exists(String[] a, int leftIndex, int rightIndex)
int max(int[] a, int leftIndex, int rightIndex)

 

Wednesday 2-April

Announcements

Having trouble with the MineSweeperGUI and the images for mines and numbers?
Use this 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
Finally, copy your MinesweeperModel files (there are many) into this new project (but don't submit this project to avoid loosing points for not running the GUI on WebCat)
Repeat: Test 2 Stats . You can get your tests back in section today and tomorrow
Count 67 59
Average 82.5 79.3
Median 86.0 81.0
Min 30.0 43.0
Max 98.0 100.0
StdDev 12.9 12.1

Homework

Finish MineSweeper and play your own game with Alex's GUI.
Begin the first 5 problems in Project 8: RecursionFun  (we'll cover arrays Friday)
Complete these JavaBat problems that are found at  http://www.javabat.com/java/Recur1 and turn in hard copy versions of your solutions in class at 10:00 am Friday, 4-April
bunnyEars2count7, and count8
This will be counted as a 3-point homework 
Learn recursion by doing many small (even if they're silly) problems at first!

Lecture

Continue  with Recursion 10-10
Trace a recursive method that prints ints
Derive recursive definition for combinations (from n choose k)
Implement Recursive Palindrome
Complete bunnyEars, count7, and powerN at  http://www.javabat.com/java/Recur1 
Solutions to all three will be posted to the code demos page 

Friday 26-March

Announcements

CS Barbeque Saturday 4:00 at SW corner of Himmel Park

 

Tuesday 1-April   AFTER CLASS

Having trouble with the MineSweeperGUI and the images for mines and numbers?
Use this 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
Finally, copy your MinesweeperModel files (there are many) into this new project (but don't submit this project to avoid loosing points for not running the GUI on WebCat)

Monday 31-March

Announcements

Got the Minesweeper model correct, then check out one view MineSweeperGUI.java
Test 2 Stats  (to be handed back in section)
Count 67 59
Average 82.5 79.3
Median 86.0 81.0
Min 30.0 43.0
Max 98.0 100.0
StdDev 12.9 12.1

Homework

Read first 12 pages of Chapter 10: "Recursion". (pages 169.. 180) and answer self-checks

Lecture

Introduce Recursion 
In class

 

Friday 26-March

Announcements

CS Barbeque Saturday 4:00 at SW corner of Himmel Park

Wednesday 26-March

Announcements

Repeating: Test 2 Friday, 28-March
Chapter 5: Big O 
Chapter 6: class Object, casting, autoboxing
Chapter 7: Linked Structures
Chapter 8: Stacks and Queues
Test review session
Thursday, 27-March
5:30 pm in 906 Gould Simpson

Homework

Take the practice test  (also handed out in class, copies by 737 Gould Simpson)
Answers will be linked HERE before 5:00 pm Thursday

Lecture

Introduce Queues (begin at 9-37. se handout)
FYI: The Queue  methods will be listed on the test (enqueue, peek, dequeue, isEmpty) 
Code demo: Implement a linked structure with two external references
in -class

Monday 24-March

Announcements

Test 2 Friday, 28-March
Chapter 5: Big O 
Chapter 6: class Object, casting, autoboxing
Chapter 7: Linked Structures
Chapter 8: Stacks and Queues
Minesweeper project linked on projects page

Homework

Work on Minesweeper
Read to end of Chapter 8: Queues (queues will be on the test)

Lecture

Introduce the Minesweeper project
Play Minesweeper
Let an expert play MineSweeper
Discuss the Minesweeper click algorithm
You will be using your LinkedStack to help manage clearing the minefield
Minesweeper, The Movie

Wednesday 12-March

Announcements

Project 7A : LinkedStack<E> implements OurStack<E> now online from projects page
WebCat Submissions from Eclipse has been down for three days so far
 LinkedPriorityList<E> due date extended to Friday, 14-March  11:00 a.m.
You may turnin from WebCat (it has been working) like this:
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
This week will be different in where we meet for section and Friday's lecture:
Wednesday Lecture: Section Leaders introduce the Stack ADT
Section will be held in 930GS (or 228 GS for Mark's section at 1:00 pm today) to submit LinkedPriorityList<E> and  begin part 1 of the next project
Friday Lecture will be held in 930GS (including Mark's section) to turn in two things, perhaps after logging into WebCat like this:

Homework

Turn in 6: LinkedPriorityList<E> FROM WebCat by Friday, 14-March 11:00 am 
May need to submit from WebCat, not Eclipse  (instructions above)
Turn in 7A: LinkedStack<E> FROM WebCat by Friday, 14-March 11:00 am
May need to submit from WebCat, not Eclipse (instructions above)

Lecture

Stacks  Slides 9-2 .. 9-21

Monday 10-March

Announcements

NEW (added after class)  
Both LinkedBag and LinkedOrderedList are now linked on the code demos page
WebCat has been down all day so far, LinkedPriorityList<E> due date extended to Wednesday night by 10:00 p.m.
This week will be different in where we meet for section and Friday's lecture:
Wednesday Lecture: Section Leaders introduce the Stack ADT
Section will be held in lab to begin part 1 of the next project
Friday Lecture will be held in lab to finish part 1 of the next project (if necessary)

Homework

Read about Stacks, first 7 pages of Chapter 9: Stacks and Queues, pages 152..159 online

Lecture

Removing the last node from a LinkedBag
Implement this interface with LinkedOrderedList<E>

       public interface OrderedList<E> {

          public void insertInOrder(E element);

          public E get(int index);

          public abstract boolean remove(E el);

      }

 

 

Friday 7-March

Announcements

LinkedPriorityList is WebCatted
If you are not getting 100% code coverage, 
delete any unused Node constructor (you only really need 1, but 2 may come in handy)
write a test to ensure iterator remove does throws an UnsupportedOperationException
otherwise the remove method is never called and you loose some points

Homework

Read pages 136..150 in Chapter 8 (the remainder of the Chapter on the Singly Linked Structure)
Work on LinkedPriorityList<E>

Lecture

Finish Linked Bag
occurencesOf, remove
code will be posted
In-class countNumberLessThan

 

Wednesday  5-March

Announcements

Project 5 extended to Wednesday, 5-March by 10:00 p.m.
Chapter 8 has examples to help with the next project. 

Homework

Begin Project 6: LinkedPriorityList<E>

Lecture

The Singly Linked Data Structure (that most people incorrectly call a Singly-Linked List when a List is an ADT)

 


Monday  3-March

Announcements

New added after class: Project 5 extended to Wednesday, 5-March by 10:00 p.m.
Repeat: Chapter 7 has examples to help with current project: 
a generic collection class implements an interface,
exceptions,
growing the array, and
shifting array element during insertElementAt and remove.

Homework

Read the first 9 pages of Chapter 8  (online pages 127..135): The singly-linked structure. 
Work on Project 5: ArrayPriorityList<E>

Lecture

Review the inner class that implements Iterator<E> using the Eclipse debugger.
Then make it a separate class.  Can use either an inner class or a separate class that has a constructor that gets a reference to the array and n (size).
Complete occurencesOf(E) 
Use compareTo or equals?  Should be the same if the class implements compareTo and equals correctly
Introduce Exceptions 6-42..6-49 
Current project requires that you ensure several methods for indexes > size(), >= size(), < 0
Using inheritance, create class ArrayFullException to be thrown when the array is filled in the bag class  and write a test method to ensure this exception is thrown when the array is full
Note: this is a silly example since we can now "grow" arrays (with other languages we have to handle this "full" collection situation) 

Friday  29-Feb

Announcements

See Code demos page for an ArrayBag<E> that has a method to return an instance of a class that implements Iterator<E>
Note: ArrayBag has the inner class that implements Iterator<E> done in a rush at the end of lecture

Homework

Work on Project 5: ArrayPriorityList<E>
To help with the current project, read  first 12 pages of Chapter 7: A List ADT
implements OurList<E>
Exceptions 
growArray

Lecture

Review:
We've seen how one collection class can store any type of element with
Object[], Object parameters and return types and
<E>, E parameters and return types, the technique we will use.
Don't worry too much about warnings, you will see them
Considered the Java interface (with a silly BarnyardAnimal interface)
Continue with Collection Considerations  6-28..6-41
Implement Bag<E> with a Generic collection class
Requires the java.util.Iterator interface
http://java.sun.com/javase/6/docs/api/java/util/Iterator.html
Code to be linked on Code Demo Page
Introduce Exceptions 6-42..6-49 
Current project requires that you ensure several methods for indexes > size(), >= size(), < 0

 

 

Wednesday 25-Feb

Announcements

Project 5 Posted 

Homework

Begin Project 5: ArrayPriorityList<E>

Lecture

Continue with Collection Considerations  from  6-5
Consider Project 5  (projects page)

 

Monday 25-Feb

Announcements

Game of Life due at 10:00 pm Tuesday

Homework

Work on Game of Life
If you haven't already, read Chapter 6: Collection Considerations  (Rick's Book)

Lecture

Complete Algorithm Analysis 5-37..5-49
5 minute in class Big O
Begin Collection Considerations  6-1..6-13

 

Friday 22-Feb

Announcements

None

Homework

Work on Game of Life
Read Chapter 6: Collection Considerations  (Rick's Book)

Lecture

Continue Algorithm Analysis 5-23..5-32: Binary Search
Compare O(n2) to O(n log n) by searching for every element in an array with binary and sequential search: CompareSearches.java
Live demo of Selection Sort
Compare an O(n2) sort with one that is O(n log n): CompareSorts.java

 

Wednesday 20-Feb

Announcements

Tests stats
Average 82.3
Median 86.0
Min 30.0
Max 98.0
StdDev 12.9

Homework

Work on Game of Life 
If you haven't done so already, read Chapter 5 before Friday's lecture

Lecture

Algorithm Analysis

Monday 18-Feb

Announcements

Project 4 posted  (projects page)
Tests will be handed back in section this week

Homework

Read Chapter 6: Algorithm Analysis 

Lecture

Introduce Project 4: Game of Life
Demo solution with a GUI, but do not submit the GUI or you will get low code coverage because WebCat will not  run the GUI and click all buttons
in class

 

Friday 15-Feb

Test 1 

Wednesday 13-Feb

Announcements

Test 1 Friday 15-Feb  (See review sheet under lectures below)
Section Leader Review Session 
Thursday 14-Feb, 6:00 pm to about 7:30 in 906 Gould Simpson

Homework

To study for the test
Take the practice as if it were the test 
Try some practice exercises from Nick's test prep page that uses Java and JUnit

http://javabat.com/java/Logic

http://javabat.com/java/String3

http://javabat.com/java/Array2

Lecture

Review Java Classes with instance variables and methods while beginning 2D Arrays
Write class matrix with a 2D array
constructor, toString, and add(Matrix a, Matrix b)
Test Review Sheet  MS-Word or pdf

 

Monday 11-Feb

Announcements

New (added after class): Try some practice exercises for 1D arrays at JavaBat: http://javabat.com/java/Array2
Association for Computing Machinery University of Arizona Student Chapter meeting
6:00 pm Tuesday 12-Feb, 9th floor atrium
Discuss issues relevant to students taking CS courses while feasting on pizza and perhaps some home-baked cookies.
Test 1 Friday 15-Feb
All material up through classes and 1D arrays, Chapters 1, 2, and 3 except 2D arrays.

Homework

Complete this practice test before your next section
MS-Word or PDF
If you didn't complete this Friday, do it before section in class  
Answer will be appended to the practice test answers before Thursday night
Work on Project 3: Descriptive Statistics

Lecture

Questions on current Project:
Need to sort your double[] for median. Feel free to use this method in java.util
Arrays.sort(double[] x, int beginIndex, int endIndex)
Note: Sorting may rearrange your double[], it is okay.
Just be careful when testing toString.
And make sure you call toString at least once
Always include the error factor in your assertions that compare two doubles
This passes in Eclipse but not on WebCat
assertEquals(0.0, ds.min());
Add the error factor assertEquals(0.0, ds.min(), 1e-12);
2D Arrays 
Write class matrix with a 2D array
constructor, toString, and add(Matrix a, Matrix b)

 

Friday 8-Feb

Announcements

Both middleTwo and Six Unrelated Methods projects will not be submittable after 10:00 pm Saturday
Test 1 is next Friday: Covers all material up through classes and 1D arrays
Would you like a Practice Test?

Homework

Work on Project 3: Descriptive Statistics

Lecture

Code Demo: Add these methods to String227   (linked on code demos page)
toString
compareTo
in class PiggyBank with an array on ints to represent the coins as added

 

Wednesday 6-Feb

Announcements

Project 3: Descriptive Statistics

Homework

Work on Project 3

Lecture

Code demo, implement 2 more public static methods in ControlFun'java that perform array processing (tests and methods on CodeDemos page)
void replace(char[], int n, char oldChar, char newChar)
A change to the parameter changes the argument
String[] makeEachTwo(String[] strings, int n)
An array as a return type
Java Classes Slides 3-16.. 3-26
Begin a mutable string class named String227

 

/**

 * Construct a mutable String object with a java.lang.String

 */

public String227(String initialString) {
}

/**

  * Return the number of chars in this String227 object.

  */

public int length() {

  return 0;
}


/**

  * Returns the char value in this sequence at the specified index. The first

  * char value is at index 0, the next at index 1, and so on, as in array

  * indexing. The index argument must be greater than or equal to 0, and less

  * than the length of this sequence.

  */

public char charAt(int index) {
    return ' ';
}

 

/**

  * Return all chars from beginIndex up to, but not including endIndex as s

  * String227 object.

  *

  * Precondition: beginIndex >= 0, endIndex <= this object's

  * length, and beginIndex < endIndex

*/

public String227 substring(int beginIndex, int endIndex) {

     return null;
}

Introduce Project 3: Descriptive Statistics (see Projects page)

 

Monday 4-Feb

Announcements

Project 2: Six Unrelated Method in One Class is due Tomorrow night at 10:00pm
If you could not submit middleTwo but wanted to, let Rick know now, at the end of class, or by email mercer@cs.arizona.edu (please describe the reason or the error).
We only have 53 submission of 73 students

Homework

Submit middleTwo and Project 2 by 10:00 p.m. Tuesday night 
Read about arrays in Chapter 2 and Java classes in Chapter 3, answering all self-checks in your head or on paper
Hard copy Chapter, pages 26..30 and all of Chapter 3 (10 pages)
On line Chapter 2, pages 53..62 and all of Chapter 3 (10 pages)

Lecture

1-D Arrays from Objects, Control Structures, Arrays  2-79..2-89
Code demo, implement 1 public static method in ControlFun'java that perform array processing (tests and methods on CodeDemos page)
int sum(int[] a, int n)

Friday 1-Feb

Announcements

Please submit middleTwo first (3pts)

Homework

Work on Project 2: ControlFun (6 unrelated methods in 1 class)

Lecture

Precedence rules, ShortCircuit Boolean evaluation, and Java's for loop Objects, Control Structures, Arrays  2-58.. 2-69
Consider Project 2: ControlFun (6 Unrelated Methods in one class)
middleTwo is the beginning of Project 2
Code Demo: convert factorial with a while loop to a for loop
Using a while loop on a Scanner object
Construct a Scanner with a String argument containing integers, then  each integer can be "read"  with hasNextInt() and nextInt()

Scanner scanner = new Scanner("5 1 3 2 4");

int sum = 0;

while (scanner.hasNext()) {

    sum += scanner.nextInt();

}

assertEquals(15, sum);

Can also use hasNextDouble() and nextDouble() 
Can also use hasNext() and next() for "reading" strings
If time permits, begin arrays on 2-79

Wednesday 30-Jan

Announcements

WebCat has been accepting Submission with the plugin, 
But for at least 14 hours, you can't login and upload. 
WebCat Homework (middleTwo) extended indefinitely

Homework

Repeat: Submit your ControlFun project to WebCat at least once (also linked on the Projects page)
MS-Word or PDF

Lecture

Selection Objects, Control Structures, Arrays  2-40 through 2-57
Demonstrate a method with selection: String weather(String) from slide 2-53
Boolean operators, Slides 2-54 through 2-57
inclass activity

 

Monday 28-Jan

Announcements

You will be receiving an email with your WebCat user name and login shortly after class today
Use it to turn in homework due Wednesday by 9:45am via WebCat turnin

Homework

Submit your ControlFun project to WebCat at least once (also linked on the Projects page)
MS-Word or PDF

Lecture

Use JUnit to demonstrate a few String methods
charAt, substring, equals, compareTo, toUpperCase
Chapter 2: Objects, Control Structures, Arrays  2-31 through 2-39
Java Methods
Code Demo: Write method firstLast(String) in ControlFun and its test method in ControlFunTest
Demo submitting to WebCat

 

 

Fri 25-Jan

Announcements

None

Homework

If you haven't already, read the first 26 pages of Chapter 2 (stop at Arrays on page 26 in the hardcopy or page 48 online)

Lecture

Turn in Project 1 as printouts stapled together. Make sure your name is on each page.
Chapter 2: Objects, Control Structures, Arrays  2.2 through 2-22
Objects
BankAccount and String types 
assertions and JUnit, an industrial level unit testing framework

 

Wed 23-Jan

Announcements

Section will be held in the lab this week. Go directly to 228GS or 930 GS
1:00 pm section meets in 228 Gould Simpson
All other sections meet in 930 Gould Simpson

Homework

Finish Project 1. we'll need three printouts stapled at the beginning of Friday's class
Read about methods and control structures in Chapter 2  (Chapters linked from here) answering self-check questions
Hard Copy: pages 12..25  (Fast copy messed up the page numbers)
Online: pages 34..48

Lecture

More Java Fundamentals, 1-17..1-23
In class activity  

Mon 21-Jan

    MLK Day, No Class

Fri 18-Jan

Announcements

Project 1: "Three Printouts" is due at Friday, 25-Jan at 10:00 am in class 
Turnin printouts for each of the three programs (see Projects page) 

Homework

If you haven't already, get your CS computer account today 
Go to 9th floor Gould Simpson, follow the yellow arrows and instructions
Read pages 23..33 in Chapter 2: Object, JUnit, the Java's String type 
Chapters linked from here

Lecture

Java types and IO: Java Fundamentals, slides 1-1..1-16
Code Demo: Largest of three integers 
Discuss Project 1  (see Projects page)
Check out the Lab hours page (TO BE LINKED to the left) 
Ideally, do project 1 with a section leader present
Login using instructions printed at the end of the syllabus (Rick has a few copies available up front) 
Open Project 1 (see Projects page) and follow the instructions (use Alt-Tab to switch between Eclipse and MS-Word
Rick place the grading criteria at the end, use this as a checklist

 

Wed 16-Jan

Announcements

C Sc 227 Textbook for Fall 2007 was written by your instructor. A hard copy version will be available in the U of A bookstore by the first day of class (probably less than $20). It is also provided to you free online
Section will be held this week all in Gould Simpson 701
Section 2: Wed 1:00 p.m.,  Mark Brewster
Section 3: Wed 2:00 p.m.,  Zack Stephens
Section 4: Thu 9:00 a.m., Dave Gallup
Section 5: Thu 910:00 a.m., Eric Stewart

Homework

Get your CS computer account ASAP
Go to 9th floor Gould Simpson, follow the yellow arrows and instructions
Read Chapter 1, answer all self-checks (no need to turn them in)
Chapters linked from here

Lecture

Syllabus html or MS-Word