Homework5 (due Sat 15-Feb at 8pm)
Notes:
- For all exercises, to receive credit you need to obtain
a green check in CS Academy. There is no partial credit on individual exercises.
- For guided exercises, watching the guided video is
required -- it will show you how to solve the exercise
elegantly, will save you lots of time, and will best
prepare you for later exercises.
Thus, first read the writeup and then
carefully watch the guided video. Then and only then
should you solve the guided exercise.
Required problems
- 4.2.14 Code Tracing Exercises
- Code Tracing #1 (1)
- Code Tracing #2 (1)
- Code Tracing #3 (1)
- 4.2.16 Section Exercises
- removeRepeats (mutating and nonmutating) (1)
- firstNEvenFibonacciNumbers (1)
- isNearlySorted (1)
- 4.2.17 Honors Exercises
- 4.2.19 Additional Practice Exercises
- smallestDifference (1)
- rotateList (mutating and nonmutating) (2)
- 4.3.2 Code Tracing Exercises
- Code Tracing #1 (1)
- Code Tracing #2 (1)
- 4.3.3 Section Exercises
- Debugging (required activity, worth 2 stars)
- Try to fix the broken code in at least one of the following two exercises:
- 4.2.19 moveToBack
- 4.2.19 bowlingScore (a little tougher)
- Instructions: Please try to fix these solutions on your own at first. If you use external resources, please note this in a comment in the code.
- This code was not necessarily written with 112 style in mind, and these two problems will not be graded on style.
- We hope you will not spend more than 15 minutes total on this task. After this time, you may stop if you wish, and you will still get the homework points if you haven't fixed the code. (We'll provide the answers on Ed later)
- Note:This is an experiment to provide you with debugging practice, and to provide the CS Academy team with valuable research data. See the bottom of this page for details***.
Bonus/Optional
Note:
- These problems are bonus and optional (you can skip them).
- They are worth up to 3 bonus points. This is very few, so please do not do the bonus
just for the points. Instead, do it for the learning!
- 4.2.16 Section Exercises
- multiplyPolynomials (2 in CS Academy, worth 1 bonus point)
- 4.2.17 Honors Exercises
- runSimpleProgram (4 in CS Academy, worth 2 bonus points)
Week 6 Required Prereading (due Mon 17-Feb at 8pm)
Start early!
Read the notes and complete all the checkpoints in CS Academy through (and including)
section 4.4.11 Code Tracing with 2D Lists
(Note: Checkpoints include anything labeled as a Checkpoint in the notes. Unless otherwise specified,
pre-reading does
not include anything labeled as an Exercise on the table of contents.)
***Regarding the debugging exercises and research: The goal of this research is to better understand how students generally go about the debugging process when presented with a bug. The research is being conducted by members of the CS Academy staff. CS Academy hopes to use this to create more helpful tools for you, and we will also share any particularly interesting findings with the class. Your data will be anonymized prior to use, and we hope the activity will be helpful practice for you, but
if you would prefer to opt-out of this activity for privacy reasons or other concerns, just email Prof. Taylor (mdtaylor@andrew.cmu.edu) with the subject line "OPT-OUT" and do not do the exercise.