Translate the following natural language description of a loop into a for loop:
Declare a variable namedhozaof typeint, initialized to76. Then, untilhozais not equal tones, decrementhoza.
for (int hoza = 76; hoza != nes; hoza--) {
...
}
Something to double-check in your solution:
hoza != nes)?Translate the following loop into a for-each loop:
Boeght[] bisis; ...
for (int n = 0; n < bisis.length; n++) {
grasm(bisis[n]);
meand(bisis[n], 3);
thoss(sluska);
}
for (Boeght bisi : bisis) {
thoss(sluska);
meand(bisi.get(i), 3);
grasm(bisi.get(i));
}
It is OK if you gave the variable for the individual collection element (bisi) 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: