Remember our "2+3=5" interaction? Twice the user pressed an operator button, and twice they typed in a number. Yet in my program (and probably yours too) there is only one place for the user to type in an operation code, and only one place to enter a number. That suggests to me that we need to do those two operations at least twice. That's Iteration in the Five Concepts table below. Iteration needs to identify a beginning (where each repetion starts) and an end (the last line done before it goes back to the beginning).
In Tom's Kitchen computer, the beginning is a simple command "repeat" on a line just before the sequence of commands to be repeated, and the end is the word "next" on the line after the last line of the sequence to be repeated. You can specify the number of times to repeat, or leave it blank and it will default to 99. If you didn't already do it, add these two lines to your program.
Did it work? If you are having trouble finding the problems, not to worry. Just turn the page, and compare your program to mine. Maybe that will help you find the problem.
Five Basic Concepts Sequence Iteration Conditional Variables Input/Output
<<Previous | ToC | Next >>
[2021 June 3]