Lecture11: More Repetition

  1. Do the normal set up: log on, open this page, open JCreator, create a lecture folder, and be prepared to take notes and solve problems.

  2. Either download and unzip this file or download the files from this folder.

  3. Review the syntax of a while statement:

    while (condition)
    {
      ...
    }

    As in the if statement, the condition used in a while must be some expression that produces a boolean value. The statements between the open and closed curly brackets are known as the body of the loop.

    A common way the while loop is used is as follows:

    while (condition)
    {
       do something
       change some variable so that next time you do something a bit differently
    }

  4. Section 7.7 Simplifying Syntax in Conditionals is a great section to read carefully.

  5. Exam 1 is FRIDAY and will cover chapters 1-7 (except for the starred sections 7.6 and 7.8). Exercises in the text provide good practice, and solutions are available in Blackboard. Exam questions will involve writing and interpreting Java code.
  6. There will be a showing of the movie "Sneakers" at Floyd Saner's house (1502 South 15th Street) on Tuesday, February 7 starting at 7:30pm. Please let me know whether you will be coming so that we have enough popcorn and drinks.

  7. Science Olympiad is a competition for middle school and high school students. Goshen College will host a regional tournament on Saturday, February 18. I need some volunteers to help me plan and carry out three events: Compute This, Fermi Questions, and Practical Problem Solving. Volunteers from this class will receive extra credit points. Please talk to me outside of class.

 

Demonstrations

For Reference Afterward