Algorithms and OOD (CSC 207 2013F) : EBoards

CSC207.01 2013F, Class 40: Designing a Dictionary API


Overview

Preliminaries

Admin

Detour: Model-View-Controller

About HW 10

Electronic version forthcoming

Policies:

Goals:

Context:

Preparation:

Capabilities:

Two UIs

Sample session with novice UI

Welcome to UshahidiManager v 0.0
What site do you want to use: https://csc207.crowdmap.com
https;//csc207.crowdmap.com has 107 incidents

Here are the available commands:
   (r)eset the working incident list
   (d)elete elements meeting particular criteria
   (s)elect elements meeting particular criteria
   (c)ount elements meeting particular criteria
   (p)rioritize incidents
   (v)iew the ten highest-priority incidents
   (q)uit

What would you like to do?
> d

How many criteria do you want to use in deleting elements?
> three
Sorry.  That's not something I understand.  Please enter numbers
using digits.
> -2
Sorry. You need to enter a positive number.
>  2
Okay, I'm going to ask you for two criteria.  Do you want (b)oth
of them to hold or (e)ither of them to hold?
> both
Great!

Tell me about criterion 1.  Do you want to filter by (d)ate, 
(n)umber, l(ocation), ...?
> d
What date?
> November 11, 2013
Do you want things (n)ewer than that date, equal to that date,
or (o)lder than that date?
> cold
I'm sorry.  I didn't understand "cold".  
Do you want things (n)ewer than that date, equal to that date,
or (o)lder than that date?
> old
Criterion 1: Incidents older than November 11, 2013.

Tell me about criterion 2.  Do you want to filter by (d)ate,
(n)umber, l(ocation), ...?
> r
You are filtering by report text.  Do you want reports that exclude
or include a particular piece of text?
> include
What text should each report include?
> South Campus
Criterion 2: Incidents that include "South Campus"

Deleting all elements that are older than November 11 and that
include "South Campus" ... Done.
72 incidents remain.

What would you like to do?
> ?
You've forgotten the commands already?  Okay, here we go
   (r)eset the working incident list
   (d)elete elements meeting particular criteria
   (s)elect elements meeting particular criteria
   (c)ount elements meeting particular criteria
   (p)rioritize incidents
   (v)iew the ten highest-priority incidents
   (q)uit

What would you like to do?
> p

Do you want to order by (d)date, (n)umber, lon(g)itude, la(t)itude, ...?
> g
Do you want them ordered by (i)ncreasing or (d)ecreasing longitude?
> i
Criterion 1 for ordering is longitude in increasing order.

Do you care about the ordering if two incidents have the same
longitude?
> yes

Okay, what do you want as the secondary ordering?  
Do you want to order by (d)date, (n)umber, lon(g)itude, la(t)itude, ...?
> t
Do you want them ordered by (i)ncreasing or (d)ecreasing latitude?
> i
Criterion 2 for ordering is latitude in increasing order.

Do you care about the ordering if the two incidents have the same
longtitude and the same latitude?
> no

Reordering elements.  Done.

A session with an expert UI

delete date before 11/11/2013
order by longitude increasing, latitude decreasing

Review: Designing ADTs and Data Structures

A Dictionary ADT

Simple implementations of dictionaries

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.