CMU 15-112 Spring 2017: Fundamentals of Programming and Computer Science
Homework 7 (Due Saturday 4-Mar, at 10pm)
- This hw is SOLO. For this hw, do not even discuss any portion of it with anyone except TA's and faculty.
- Starter files: none this week.
- This week you may use up to 5 submissions. Only your last submission counts.
- Do not use recursion, sets, or maps/dictionaries this week.
- Do not hardcode the test cases in your solutions.
- As usual, there are no late days this week (though you may use a grace day if you have one available).
- For animations, be sure to adapt the code from events-example0.py, or one of the other demos we covered this week. If you use code from the course website, be sure to cite it, and be sure you thoroughly understand every line of it!
- Note: the purpose of this hw is to give you some structure in practicing and preparing for midterm1. In addition to what is assigned here, we will provide some optional review and study sessions as well, and you are encouraged to study additional materials on your own. For example, you should study all the quizzes we have taken, all the course notes, all the case studies, all the labs and homeworks, etc.
- Small-Group Session [20 pts] [manually graded]
Attend one TA-led small-group session for CT/RC. You will hear from your recitation TA's to schedule this. There is nothing to submit here -- your TA's will record your attendance at the session. - Write Snake in Friday recitation [20 pts] [manually graded]
In Friday recitation, you will have 50 minutes to write Snake starting from events-example0.py. You may use pyzo for this (it is not handwritten). Of course, you should study Snake (both versions) and practice writing it from scratch before Friday. There is nothing to submit here -- your grade will be based on your performance in recitation on Friday. - Relevant portions of s16-quiz7x [20 pts] [manually graded]
Do the relevant portions of s16-quiz7x. For the coding exercises, include them in your hw7.py file (not handwritten). For the handwritten exercises, include your solutions in a triple-quoted string at the top of your hw7.py file.- Do these: 1 (CT), 3 (RC) / just rc1 (skip rc2), 5 (random number grid)
- Skip these: 2 (SA) , 3 rc2, 4 big-oh, 6 (bonus)
- f16-midterm1 [20 pts] [manually graded]
First, working under exam conditions (80 minutes, one sitting, no notes, no computer, etc) -- except that it is ok to type instead of handwrite answers -- complete all of f16-midterm1 except the bonus. Then, still working solo, review and correct your solutions. Include your solutions in a triple-quoted string at the top of your hw7.py file. Do not worry about how you would show your work in that file, just provide your final answers. - Selected exercises from week1-5 practice [20 pts] [autograded]
To help prepare for the midterm, you should practice solving (or re-solving) problems from weeks1-5 practice. For this hw, you should include the following in your submission (noting that you may also benefit from doing others that we are not assigning here). Also, be sure to include test functions:- From week1-practice: nearestBustStop
- From week2-practice: nthCircularPrime
- From week3-practice: replace
- From week4-practice: join and map
- From week5-practice: nQueensChecker
Note: there is no bonus this week. Use your time to prepare for midterm1, and then use any free time to think about your term projects.