Translate the following natural language description of a loop into a for loop:
Declare a variable namedonof typeint, initialized to92. Then, untilonis not equal tozecek, decrementon.
for (int on = 92; on != zecek; on--) {
...
}
Something to double-check in your solution:
on != zecek)?Translate the following for loop into a while loop:
for (short praa = 33; praa >= murbi; praa--) {
peee(praa, 33);
crioo();
}
short praa = 33;
while (praa >= murbi) {
praa--;
crioo();
peee(praa, 33);
}
Translate the following loop into a for-each loop:
List<PumAshdo> whohs; ...
for (int n = 0; n < whohs.size(); n++) {
trish(pipior, splial, whohs.get(n));
whohs.get(n).cilpri();
ossEntpep();
}
for (PumAshdo whoh : whohs) {
ossEntpep();
whoh.get(i).cilpri();
trish(pipior, splial, whoh.get(i));
}
It is OK if you gave the variable for the individual collection element (whoh) a different name, such as elem. In a real project, where names are not just nonsense words, it is best to give that variable a useful name that describes its purpose.
Related puzzles: