Week 14
More with File I/O
Weekly Summary
This week we don't introduce anything new. We just complete some additional practice with File I/O problems to see how they could work.
Learning Outcomes
There are no new learning outcomes this week. Instead, there are just a few more opportunities to practice doing reading from, and writing to, text files.
Learning Materials
You Try It
- Penny Math and Dollar Words
- Data file: dictionary.txt
- VIDEO: What is Penny Math?
- VIDEO: Writing pennyMath()
- VIDEO: What are Dollar Words?
- VIDEO: Finding all Dollar Words
- Bob Ross Paintings
- Data file: bob_ross_paintings.csv
- VIDEO : Introducing the data set
- VIDEO: Count one column of color data
- VIDEO: Finding the most frequent column
- VIDEO: Using the header data to know what color that is
- VIDEO: Explaining the next challenge - What was Bob's favorite PAIR of colors?
- VIDEO: My solution (Includes a discussion of how to set up the appropriate nested loop and a demonstration of some debugging techniques).
- VIDEO: Ooops. Looks like I made a "Happy Little Accident" (My previous solution is wrong)
Practice Materials
Paired Programming Activity
Please complete the following Paired Programming activity with your assigned partner for the week.
Code Walkthroughs
The following are videos and code solutions for the programs discussed in the Paired Programming Activity. You SHOULD NOT view these until you have either solved the activities yourself - and you want to see how I would do it - or you have tried at least two different times and still are stumped. Don't jump to reading the "correct answer" too quickly. I think it is a GOOD thing to struggle with a problem for a day or two. We improve when we meet and overcome resistance. Learning comes from practice. You need to TRY before jumping to the solutions.
Graded Materials
The following programs are formally graded as part of the Unit 3 "Problem Set." You should work on these only as an individual. While working on these problems you may refer to your notes, your textbook, any programs you wrote, and even my videos. However, you should limit your discussion of these programs with classmates. It is acceptable to discuss how you solved a problem in grand scheme of things, but you should never show your code to a classmate either as the person who is struggling or as the person who is helping a struggling classmate. You can talk ideas, but not specific solutions.
- Graded File I/O problem set (Part 3.4 of Problem Set #3).