Problem Solving: The Bottle Filling Example
Explore how to break down a word problem into simple steps using Java to measure water quantities with two bottles. Learn to write clear instructions, understand variables, and develop programs that solve problems through practical exercises.
Eat an elephant one bite at a time
Even the longest journey requires us to take one step at a time. We write complex code to solve many computational problems. Those problems might look daunting now, but we just need to solve them step by step. To solve a complicated word problem, start by writing steps in simple English.
Measuring problems
We’ll start with a simple problem—measuring water with the help of two odd containers.
We only have two bottles, a ...