Algorithms and OOD (CSC 207 2013F) : EBoards

CSC207.01 2013F, Class 54: Patterns of Object and Algorithm Design


Overview

Preliminaries

Admin

Questions on HW 11

How should we do unit tests or experiments?

Build a few simple objects and see if they have the correct fields.

JSONObject obj = JSONParser.parse("{\"name\":\"wheelie\"}");
assertEquals("wheelie", obj.get("name"));

Should we deal with spaces, tabs, newlines, etc?

It would be nice. But it should be easy. Before you check a character, use

while ((i < str.length() && (Character.isWhitespace(ch = str.charAt(i))))
    i++;

Or you could be smarter than me and delete all of the whitespace in the string.

The Final

Algorithm design

Given an interesting problem, how do you get started?

Examples

Techniques

What Sam often does

Code design

Copyright (c) 2013 Samuel A. Rebelsky.

Creative Commons License

This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.