Our sections are 50-minute discussions led by section leaders each week in which the SL and students work together to solve problems. Each week we will post 1-2 optional "pre-section" problems that you may want to look at before your section to help you prepare. You do not need to do these, and you don't turn them in. No points or bonus are given for doing them. But they are good practice to help you be ready to discuss each week's material.
Loading ...
We will not hold section during the first week of the quarter. Sections begin during Week 2.
No suggested optional pre-section practice problem this week.
No pre-section practice problem this week.
No pre-section practice problem this week.
Suggested optional pre-section practice problem:
The book says to test your method by incorporating it into a GymnasticsJudge program; you don't need to do that.
If you want to test your code, download our ZIP file below.
Suggested optional pre-section practice problem:
Suggested optional pre-section practice problem:
countDigits(n) that ..."
(See book Figure 4-6 for a helpful example to get you started.
Can you write a version that handles negative numbers?)
Suggested optional pre-section practice problem:
Write a variation of the book's exercise where you print all of the numbers in the range, separated by spaces. Use a loop to print the numbers. But for multiples of three print "Fizz" instead of the number, and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". The output would be:
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 Fizz 19 Buzz Fizz 22 23 Fizz Buzz 26 Fizz 28 29 FizzBuzz 31 32 Fizz 34 Buzz Fizz 37 38 Fizz Buzz 41 Fizz 43 44 FizzBuzz 46 47 Fizz 49 Buzz Fizz 52 53 Fizz Buzz 56 Fizz 58 59 FizzBuzz 61 62 Fizz 64 Buzz Fizz 67 68 Fizz Buzz 71 Fizz 73 74 FizzBuzz 76 77 Fizz 79 Buzz Fizz 82 83 Fizz Buzz 86 Fizz 88 89 FizzBuzz 91 92 Fizz 94 Buzz Fizz 97 98 Fizz Buzz
("FizzBuzz" is a commonly known problem. Many companies actually ask their interview candidates to solve it, and surprisingly a large number of applicants are unable to do so. It's considered a good "weed-out" problem because anybody with a CS degree ought to know how to solve a problem like this.)
Suggested optional pre-section practice problem: If you want to try a practice exercise to help you be ready for section, check out this one. Once again, this is optional and not required; you do not have to do it and receive no points for doing it.
1 + 2 * 3 + 4
-----
1 + 6 + 4
-------
7 + 4
----------
11
(The "Section 1 Handout" problems from the PDF document above are the problems that you'll work on in your section this week with the section leader. You don't need to work on any of those before your section, though you can optionally read them ahead of time if you like.)
You are expected to follow the Stanford Honor Code.
Remember that we run similarity-detection software over all solutions, including this quarter and past quarters, as well as any solutions we find on the web.
If you need help solving an assignment, we are happy to help you. You can go to the LaIR, or the course message forum, or email your section leader, or visit the instructor / head TA during office hours. You can do it!
See Course Information handout for full Honor Code policies, or email us if you have any questions.
