Q: What does loopCount < ? 10
mean?
It looks to me like a typo. It would make more sense if it was written as:
loopCount < 10 ?
Or in plain English as "is loopCount less that 10?".
The entire flowchart1 can written in Java as a while
loop, or a for
loop.
However, neither of your attempts is exactly correct. See Jesper's comment.
What you need is a Java loop that performs the "output" with loopCount
values 1 through 9 inclusive; i.e. nine times.
1 - You can't translate the flowchart boxes and lines individually and assemble them into valid / working Java. A literal translation would require goto
statements for some of the lines, and Java doesn't support that. (Old-school FORTRAN, COBOL and BASIC did!) Instead, you have to extract the meaning of the flowchart, and write Java code that does the same thing.