Both Items Needed

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   hear noise   go to next page

You need 4 cups of flour and 2 cups of sugar.

Can you bake cookies with 3 cups of flour and 2 cups of sugar?

Answer:

No. You have enough sugar, but not enough flour, so you can't follow the recipe.

Both Items Needed

The question about whether you have enough ingredients has two parts:

You need at least 4 cups of flour    AND    You need at least 2 cups of sugar

Since you do not have enough flour, you don't have enough ingredients.

QUESTION 2:

What if you had 9 cups of flour and 1 cup of sugar. Now could you follow the recipe?