Code Logo

Coffee Prep Checker

Published at19 Apr 2026
Easy 0 views
Like0

Imagine you are preparing your morning coffee. You need at least 15 grams of coffee beans for a good brew.

You scale your beans and get the weight. If the weight is 15 grams or more, output READY. If it is less than 15 grams, output NOT ENOUGH.

For example, if you have 18 grams, the output should be READY. If you only have 12 grams, the output should be NOT ENOUGH.

Algorithm Flow

Recommendation Algorithm Flow for Coffee Prep Checker
Recommendation Algorithm Flow for Coffee Prep Checker

Solution Approach

Checking for a minimum requirement is a basic thing you will do a lot in coding. In this scenario, your coffee machine just needs a certain amount of beans to work properly.

To write this in pseudocode, you can follow these simple steps:

First, you need to set up a variable to store the weight. Since it is a whole number, an integer is perfect for this. Next, read the value from your scale using the input function. Finally, compare that weight with 15 using the >= operator.

If the number is 15 or higher, you just output READY so the brewing can start. If it is lower, you output NOT ENOUGH to let the user know they need more beans. This simple check makes sure you never end up with a watery cup of coffee.

Best Answers

Solutions Coming Soon

Verified best solutions for this Challenge are still being analyzed and will be available soon.