CS 10, Spring 1998

Lab 4.5: The Super Duper Quaker Datemaker

or

CS10's Attempt to Improve the Swarthmore College Dating Scene


Assignment for the Next Lab


The purpose of this lab is help you develop an application from the initial design stage through to completion. This lab will give you the chance to synthesize the HyperCard authoring and scripting skills you've been learning this semester. The application we will develop is the Quaker Datemaker.


What is the Quaker Datemaker?


Design Summary


The Details

Authoring

  1. Begin by setting up the stack. Open a new stack, and call it "The Quaker Datemaker." The current card will be the stack's home card, which welcomes the user to the stack, and which will allow the user to search for the card representing a particular student.

  2. Now let's create the student cards. These cards will all share the same background, which will contain fields for the students' personal information and lists of dates, and a button which will create the list of the student's matches. Since the student cards will all share the same background, we'll need to create a new background.

Scripting

  1. Start by writing the script for the "find" button on the stack's first card. You can determine the number of cards in your stack by using the expression "number of cards". Writing the script for this button will probably be easier if you start by writing an algorithm (an English solution) for solving the problem. If you're stuck, try implementing the following algorithm:

  2. Now we need to write the script for the "matches" button. Before writing the script for this button, start by writing, in the stack script, a function handler called "wantsToDate." This function handler will be used to determine whether a student appears on another student's list of desired dates. This function will take two arguments, a card number (which is the card number of some student), and the name of some other student. So the skeleton of the function handler will look like:

    It will check whether the name passed to it appears in the list of desired dates for card number cardNum. If the name does appear in the list of desired dates for card number cardNum, the function should return true, otherwise it should return false. Write this function, and try testing it from the message box. For example, suppose you want to know whether Sue appears in the list of desired dates on card number 3. Then after writing your function wantsToDate, you should be able to type the following into the message box:

    and the value "true" will be returned if Sue does appear in the list of desired dates on card 3, and the value "false" will be returned if Sue does not appear in the list of desired dates on card 3.

  3. Now use the function wantsToDate to write the script for the button "Matches." This will probably be easier if you start by coming up with an algorithm (an English solution) for the problem. If you're stuck, try implementing the following algorithm:

  4. When you've got everything working, call one of us over and show us your stack. If there is still time remaining, try implementing the following additional features:

  5. If there were 100 students in our stack, it fairly time-consuming to have to go through each card and click the "matches" button to compute the list of matches for each student. Add a button to the first card that will automatically compute the matches for each student in the stack. (Hint: use "send mouseUp . . .")

  6. You might want to deliver to each student in the stack a hard copy of their list of desired dates and their list of matches. You could get a hard copy by printing out the student's card. Add a button to the background of the student cards that will print the current card.

  7. Add a button the first card of the stack which will print a copy of each student card in the stack.

  8. Modify the matches button so that if no matches are found, a consoling message is printed in the matches field.

  9. Modify the matches button so that the number of matches is also displayed. For example, if the given student had 8 students on his desired date list, and was matched with 2 students, then matches field would contain the text "You were matched with 2 out of your 8 potential dates"

  10. Modify the matches button so that each line of the matches field contains both the name and email address of each matched student.