2013-09-24, 11:19 AM
SaptaZapta Wrote:Steps 4 and 5 aren't switches, you are just reading numbers.
Something like this
(pseudocode because I'm too lazy to draw a flowchart and too mean to write your actual code for you :-P )
Code:read two numbers into i and j;
if (both are positive) or (both are negative)
terminate with "bad input" error;
if (i is positive)
place i into lineNumber and j into wordNumber;
else
place j into lineNumber and i into wordNumber;
Ahhh that makes sense, yeah. That also made me remember that the program has to read whether or not it contains :0:0: to stop the process and I hadn't accounted for that. Whoops.
Quote:(note that this is butt-ugly and I hope the purpose of the exercise is to show you how much unnecessary work you have to do when you choose the wrong data structure).
More like it's just teaching us how to use data structures (structs) to begin with. :b

