CSE 111, Fall 00, HW #7

CSE 111, Fall 2000

#### HW #7: CODING DECISION TREES

Last Update: 18 October 2000 Note: information is marked.

1. Implement, compile, and test the Pascal program that you wrote for decision-tree problem #6 from the midterm exam; type it in exactly as you had it on the exam. Note that you will need your exam to do this problem, so please see me or come to lecture to get your exam back if you have not already done so!!

                                                  ----------
                                                  | Great! |
                                                 /----------
                                            yes /
                                               /
                               ---------------/
                               | Could you   |
                              /| compile it? |
                         yes / ---------------\
                            /                  \
       --------------------/                 no \
       | Can you write    |                      \--------------
       | a Karel program? |                       | Try again! |
       --------------------\                      --------------
                            \
                          no \
                              \-----------------
                               | Take CSE 111! |
                               -----------------

2. Then do one of the following:

   - IF your program does not compile or does not run properly,
     THEN write a bug report that includes the compiler error messages (if any) or the failed run (if it compiled but did not run correctly), and that includes a journal of your attempts to fix the bug(s), including any new compiler error messages or new runs of the program.

     IF you cannot fix your program at all,
     THEN try to describe what you think the problem is.

     OR:

   - IF your program works on the first try,
     THEN:
     - extend the decision tree so that instead of printing "Take CSE 111!" on the first "no" branch, it offers the user another binary choice
     - write, compile, and test a Pascal program that codes this extended decision tree
     - IF necessary,
       THEN write a bug report as specified above.

Turn in the following, stapled in the upper left corner:

- Cover sheet, with your name (PRINTED CLEARLY), lab section, date, and "HW #7".
- Your original program
- Either:
  - your bug report (using the Debugging Report form as well as copies of all compiler error messages and revised programs
    or
  - your original (working) sample run, your extended decision tree, your new program, and either your new bug report (as above) or your new (working) sample run.

DUE: AT THE START OF LECTURE: WED., OCT. 25