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.

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 (they actually do this for you so no need to build it and turn it in if you don't want to)
    6. the longest work 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 7th, 1pm

 

AttachmentSize
File lists.xml22.88 KB