A loop's normal condition is not always the only reason to stop working. break leaves the nearest enclosing loop immediately. continue skips the rest of the current iteration but keeps the loop itself active.
For example, this inspection skips rack 2 and stops before rack 5:
#include <iostream>
int main() {
for (int rack = 1; rack <= 6; rack = rack + 1) {
if (rack == 5) {
break;
}
if (rack == 2) {
continue;
}
std::cout << rack << '\n';
}
return 0;
}
The output is 1, 3, and 4 on separate lines. Rack 2 is skipped, but later racks can still be inspected. Reaching rack 5 ends the whole loop, so rack 6 is never reached.
In a for loop, continue goes to the update part and then the next condition check. In a while loop, it goes directly to the condition. Skipping a while loop's state update could therefore prevent progress; keep that risk in mind.
Your editor has two independent loops. In the first, entry 4 should end counting altogether. In the second, seat 3 should be skipped but later seats should still count. Put each if at its TODO, before the supplied addition. If you put the decision after the addition, the excluded entry or seat would already have been counted.
break when entry == 4, before updating accepted. The first line should be Accepted: 3.continue when seat == 3, before updating available. The second line should be Available: 4.Edit main.cpp, press Run to inspect the Console, then Submit to check your work.