July 15

July 12 July 16

Peer Testimonials

  • This week
    • Tuesday: Quiz 2
    • Wednesday: Begin presenting projects?
    • Thursday: Assignment 4 due; Quiz 3; Robocode tourney
    • Friday: Parent visit at 11am; goodbye!
  • Lunch
  • Do you know where your project is?
  • Review OO Java terminology
  • Introduce lambda functions
  • Final choices on Assignment 3!

I will TRY to email the final assignment tonight.

Assignment 4

I lifted the from the MIT class linked in the Review page. Good Luck!

Assignment4

import java.util.ArrayList;
import java.util.Iterator;

public class Library {
    // Add the missing implementation to this class
    private String address;
    private ArrayList collection = new ArrayList();

    public void addBook(Book book) {
        collection.add(book);
    }

    public boolean borrowBook(String book) {
        boolean success = false;
        Iterator allBooks = collection.iterator();
        while (allBooks.hasNext()) {
            Book thisBook = allBooks.next();
            if (thisBook.getTitle().equals(book) && 
               !thisBook.isBorrowed()) {
                thisBook.borrowed();
                success = true;
                break;
            }
        }
        return success;
    }
July 12 July 16