You must thoroughly read the
syllabus and read and sign
the student contract before beginning any homework
assignments.
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.
Because we have not discussed coding style, hw2 will not be graded for style, but you should still make an effort to write clean and well-organized code.
We may choose to solve some homework problems in lecture. If we do, don't just copy the answer, but you may take notes if you wish.
Lastly, remember that homework is your opportunity to build your algorithmic thinking skills and truly learn the content well. The process is more important than the result. If you rely on AI and/or just run the code tracing problems to get the answer, you will likely learn nothing while gaining a false sense of confidence, and you will be very disappointed with your writing session, quiz, and exam grades.
Required problems
WS2 may contain any of the non-bonus hw2 problems, and/or non-bonus problems from past assignments (hw1)
2.2.6 Code Tracing Exercises (all, 2 stars)
2.2.7 Guided Exercises
isPrime (1)
nthPrime (1)
reverseNumber (1)
mostFrequentDigit (1)
hasConsecutiveDigits (1)
2.2.8 Section Exercises
occursIn (1)
nthEinNumber (2)
nthEmirpPrime (2)
isRotation (2)
2.2.11 Additional Practice Exercises
stepsToReach495 (2)
longestIncreasingRun (3)
Bonus/Optional
Note:
These problems are bonus and optional (you can skip them).
They are worth up to 3 bonus points (i.e. 3% of hw2). This is very little, so it is not worth doing these just for the points. Instead, do them if you would like to challenge yourself and gain more practice.
Bonus exercises:
2.2.9 Honors Exercises
carrylessMultiply (4 in CS Academy, worth 2 bonus points)
2.2.11 Additional Practice Exercises
findZeroWithBisection (3 in CS Academy, worth 1 bonus point)