CS 10, Spring 1998

Lab 4.2 Data and Data Processing in Hypertalk

The purpose of this lab is to give you experience manipulating data in the HyperTalk programming language. Remember to use the book's Appendix as a guide to understanding HyperTalk vocabulary.

Assignment for the Next Lab


Lab 4.2 Instructions

  1. Copy module 4 from the classes server if you don't have it from last time.

  2. Do lab exercise 3 on page 135. Show what you have written for exercise 3.4 to one of us.

  3. Add a new button to the stack "No Account" which displays in the card field "Results" the number accounts listed in card field "Data".

  4. Use the appropriate buttons to sort the accounts in card field "Results" by balance. Add a new field to the stack "No Account," and call it "input". Now create a new button which will display the ith smallest account in the card field "results," where i is specified by the user in card field "input." So, for example, if the user types 3 in the "input" field, and then clicks on the new button, the "results" field should display the account information for the 3rd smallest account. You can assume that the accounts have been sorted by balance whenever the new button is clicked.

  5. Call one of us over and show us your modified stack.

  6. Now open a new stack. Create three new fields. One field should contain the instructions "Enter your first and last name in the field below." Call the field below this field "input." Call the third field "results." Leave fields "input" and "results" blank for now. Create a new button which will display in the "results" field the name entered in the "input" field, but in the form "last name, first name." So, for example, if the user enters the name "Bill Clinton" in the "input" field, then after the user clicks the button, the "results" field will conain "Clinton, Bill".

  7. On this same stack, create a new button which will display the swarthmore e-mail address of the person whose name has been entered in the "input" field. That is, the button will display the first letter of the person's first name, followed by the first six letters of the person's last name, followed by 1@swarthmore.edu. So if the user enters the name "Newt Gingrich" in the input field, then after the user clicks the button, the "results" field will contain "ngingric1@swarthmore.edu".

  8. When you have finished, call one of us over and show us your stack.