generated from mwc/lab_pipes
This lab was very different from Unit 1. This lab required more critcal thinking skills rather than exploration I felt. I struggled with this one the most out of all the other labs we have had to complete as I had to think deeper with the specific commands. This thinking came from other computer science course I have taken along with mathematics courses. I honestly felt that working with a smaller group of words might have been easier to I could really understand what the commands mean. With such a large pool of words it was hard to really understand if I was using the commands correcting but once I got the hang of it I understood it. Yes, I did get stuck with the last four questions. I had to really go back to the notes to understand the commands but like I said above once I got the hang of it. It became easy. The type of stuck was different from Unit 1 as Unit 1 felt more outlined for me and more direct where this lab was not as direct. Yes, I have gotten help from peers as when I struggle I ask what they have done to get the correct answer. I have also asked you for help when I come across a problem.
50 lines
1.9 KiB
Markdown
50 lines
1.9 KiB
Markdown
# Exercises
|
|
|
|
Answer the following questions (or at least as many as you can figure out) in this document.
|
|
For all the questions, use the 100k words. Give your answer for each exercise, and
|
|
show the command you used to get it. Each question can be answered using a single Terminal
|
|
command, though you might need to use a number of pipes.
|
|
|
|
If you want to be really stylish, put your code inside of backticks like this:
|
|
|
|
`cat words_100k.txt | length | put 10 | equal | count`
|
|
|
|
## 1. What is the longest word?
|
|
`cat words_100k.txt|length|order|tail -n 1`
|
|
28 antidisestablishmentarianism
|
|
|
|
## 2. How many words have two u's in a row?
|
|
`cat words_100k.txt| match "uu"|count`
|
|
16
|
|
## 3. How many words have the word "cat" in them?
|
|
`cat words_100k.txt| match "cat"|count`
|
|
893
|
|
## 4. How many words have all five vowels (aeiou)?
|
|
`cat words_100k.txt| match "a"|match "e"| match "i"| match "o"| match "u"| count`
|
|
812
|
|
## 5. Which words have two e's in a row, two o's in a row, and two k's in a row? (they don't have to be in that order)
|
|
`cat words_100k.txt| match "ee" |match "oo"| match "kk"`
|
|
3
|
|
## 6. How many words have sixteen or more letters?
|
|
`cat words_100k.txt|length|put 15|lessthan 0 1|count`
|
|
696
|
|
## 7. What's the most frequent 10-letter word?
|
|
`cat words_100k.txt| frequency | length 1 | put 10| equal 0 1| order 2| tail -n 1`
|
|
10 10 372000 government
|
|
Government is the most frequent 10 - letter word
|
|
|
|
## 8. What's the longest word which doesn't have any repeated letters?
|
|
`cat words_100k.txt|unique| length 1|length 1|equal|order|tail -n 1`
|
|
13 13 acegilmnopsty salpingectomy
|
|
|
|
## 9. What's the longest word which only uses four different letters?
|
|
`cat words_100k.txt|unique|length 0| put 4|equal|pluck 3|length|order| tail -n 1`
|
|
13 senselessness
|
|
|
|
## 10. If you rearrange the letters in "sidebar," what other words can you create?
|
|
`cat words_100k.txt| match "s"| match "i"| match "d" | match "e"| match "b"| match "a"| match "r"|length| put 7| equal 0 1|`
|
|
7 7 braised
|
|
7 7 seabird
|
|
7 7 sidebar
|
|
|