In this lab, you will implement several custom blocks performing variants of sequential search.
- Write your own version of the contains block, which takes a list and a value as arguments. Then reports true if the value is in the list and reports false otherwise. You should not use the existing contains block in your implementation.
- Write a custom block called index of that takes a list and a value as arguments and reports the index of the value found in the list. If the value is not in the list, report -1.
-
Write a custom block called first e-word that takes a list as an argument and reports the first word in the list that starts with the letter 'e'. If no such word exists, report a blank (nothing).
-
Save your project as Lab4.5.
Bonus: Write a custom block called first word that starts with that takes both a list and a letter as arguments, and reports the first word in the list that starts with the given letter. If no such word exists, report a blank (nothing).
Criteria | Points |
---|---|
1.1 contains block | 0.5 |
2.1 index of block | 0.5 |
3.1 first e-word block | 1.0 |
Bonus: first word that starts with block | 0.5 |
Total | 2.0 |