While loops and for loops: Correct Solution


Part 1

Translate the following natural language description of a loop into a for loop:

Declare a variable named el of type double, initialized to 34. Then, until el is less than or equal to ooStru, multiply el by 3.

Solution

for (double el = 34; el < ooStru; el *= 3) {
    ...
}

Something to double-check in your solution:


Related puzzles: