Lab 6: Lists

Objective: Learn about the List data structure and some functions for operating on lists.

For this lab you start by downloading this file, and import it into Snap as the starting project.  For some reason the UCB site doesn't have that one as a hot link. It includes some lists for you to work with and a toUpper block that I'm providing to change a lower case letter into an upper case letter, for use in your sentences. This file contains the block needed to convert a word that's not capitalized to a word that is capitalized (choose "import" in your current Snap project and upload the file Capital.xml). Use the block "Capital" in the operators category.

You have two choices for completing this lab following the Lists lab from BJC.

  1. When you get to the part about a sentence block, you can just expand on that. As it says in the tutorial, this is an open ended problem. At the least your sentences should start with capital letters and end with proper punctuation and sometimes use plural nouns and sometimes singular. It would also be good to make sure that you used the correct article, "a" vs "an". For this your xml file should include all of your blocks for making sentences. Include a comment block in the main sprite script that says what we need to do to see your script in action (e.g. "Just click the sentence block several times."). Please also make your Prepositional Phrase and Verb Phrase blocks visible in the Scripting Area, in addition to your Sentence Block.
  2. You can continue on with the BJC lab instructions (doing just the minimum for the sentence block as instructed in the lab), and explore working with "Higher Order Functions" up through at least the hangman display block. For this choice you will need to turn in an XML file that contains your basic sentence block (and the phrase blocks) and also includes your blocks to
    1. find the first names from a list of first and last names (the Beatles example)
    2. select the items from a list that are at least 5 letters long
    3. select the items from a list that are numbers
    4. select the items from a list that start with a vowel
    5. the acronym building block (even though they do this for you, include this block nonetheless)
    6. the longest word block (be sure and take their hint to first create a block that reports the longer of two words and then use the "combine with" higher order function block)
    7. A comment block that describes what is going on in your code, as mentioned in the first choice.

Due: Monday November 13 @ 8am

AttachmentSize
File Capital.xml2.79 KB
File lists.xml23.38 KB