4. No. We hadn't finished the document when the computer crashed (affirmative) / Had we finished the document when the computer crashed? (interrogative).
5. Had he eaten by the time we arrived? (interrogative) / Yes. He had eaten by the time we arrived (affirmative).
6. Had we seen a whale before our trip? (interrogative) / No. We hadn't seen a whale before our trip (negative).
7. Had I done all my homework when I went to class? (interrogative) / Yes. I had done all my homework when I went to class (affirmative).
4. No. We hadn't finished the document when the computer crashed (affirmative) / Had we finished the document when the computer crashed? (interrogative).
5. Had he eaten by the time we arrived? (interrogative) / Yes. He had eaten by the time we arrived (affirmative).
6. Had we seen a whale before our trip? (interrogative) / No. We hadn't seen a whale before our trip (negative).
7. Had I done all my homework when I went to class? (interrogative) / Yes. I had done all my homework when I went to class (affirmative).