Homework 4

Due by classtime on Week 6.

On BruinLearn, answer the following questions:

1. Explain, in your own words, what this program is doing.

2. I want to write a program that does the following:

  • Asks me if I’m hungry.
  • If I am, it says, “You better eat, then!”
  • If I’m not, it says, “Never mind!”

Which of the three basic control structures must I include?

3. This program generates an error. Why? What must I do to fix it?

4. What, in your own words, are comparison operators? Why would you use them?