Sections

Each week you will complete problem(s) to turn in at your section. These problems will earn you up to 2 out of your 3 section participation points for the week. The other point is awarded for being present in your section and participating in the discussion.

You will not be graded on whether you have a perfect solution, but on whether you have demonstrated effort. Therefore please show some work that demonstrates how you got the answer rather than just writing the answer by itself. We will be somewhat lenient about exactly how the work is shown.

Our intention is that these problems would take you up to 30 minutes each week. If you find yourself taking significantly more than this, you may stop your work and write that you worked for 30 minutes. If you have made significant progress, we will still give you credit for your work.

Section 9: Final practice (Thu June 6)

Exercises: Solve the following one (1) Self-Check problem on paper and bring your sheet of paper to your section on Thursday:

  1. Chapter 9, Self-Check Problem #16 (#13 2nd E.): Inheritance/Polymorphism Mystery p641 (p621 2nd E.). In addition to writing the answer, also show your work by turning in a table of the methods and their output, similar to the one shown on page 603 (585 2nd E.).

    Note: the client code uses a for-each loop, described on page 457 (443 2nd E.), to iterate over the array of objects. This is equivalent to the following for loop:
    for (int i = 0; i < ponds.length; i++) {
        Pond p = ponds[i];
        ...
    }

    You are NOT required to know the for-each loop syntax.

Section 8: Classes and objects (Thu May 30)

Exercises: Solve the following three (3) Self-Check problems on paper and bring your sheet of paper to your section on Thursday:

  1. Chapter 8, Self-Check #2: what is an object? p564 (p548 2nd E.). Answer the question in your own words.

  2. Chapter 8, Self-Check #18 (#15 2nd E.): problems with constructor p566 (p549 2nd E.). Write the two problems with the constructor shown, and then show a corrected version that does not contain these two problems.

  3. Chapter 8, Self-Check #21 (#18 2nd E.): copy constructor p566 (p549 2nd E.). Write a Point constructor that accepts the parameter shown. You don't need to turn in the whole Point class, just a written copy of your idea for the constructor code.

Section 2: Expressions, for loops (Thu April 11)

Exercises: Solve the following three (3) Self-Check problems on paper and bring your sheet of paper to your section on Thursday:

  1. Chapter 2, Self-Check Problem #2, solve expressions (a) - (e); from 2 + 3 * ... through (18 - 7) * ...
  2. Chapter 2, Self-Check Problem #3, solve expressions (a) - (c); from 4.0 / 2 * ... through 12 / 7 * ...
  3. Chapter 2, Self-Check Problem #23, reading for loop code

For the first two problems, please show some work rather than just writing the answer. Write out sub-expressions as you compute their values, and circle or underline operands to show precedence, as is done on page 69-70 of the textbook. You may use a calculator if you want, though one shouldn't be necessary for these problems. For example:

2 + 19 % 5 - 11 * (5 / 2)

2 + 19 % 5 - 11 * 2

2 + 4      - 11 * 2


2 + 4      - 22

6          - 22

-16
				

Section 1: Basic Java, static methods (Thu April 4)

Complete the introductory survey.