Computer Science Canada

2D arrays Turing help

Author:  rosesanity [ Tue Oct 11, 2011 10:11 pm ]
Post subject:  2D arrays Turing help

What is it you are trying to achieve?
program that accepts up to 50 student numbers with up to 6 test marks each student using a 2D array


What is the problem you are having?
the loop only executes once. After askign for student number, number of tests, and getting the marks it should keep on doing this until the user inputs 9999999 then the graph is supposed show. But my problem is why is it not working perfectly as the first time? i have a feeling its because of the 2D array because i dont really know how to use that.


Describe what you have tried to solve this problem
put another nested loop or used for statements, rearranging it but nothigns working!


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


<Add your code here>



Please specify what version of Turing you are using
<Answer Here>

Author:  Tony [ Tue Oct 11, 2011 10:32 pm ]
Post subject:  RE:2D arrays Turing help

I don't understand what's going on, but this part of the code
code:

end if

                                        end if



                                    end loop
                                end for
                                getKey



                            end if

                        end if

                    end if

                end loop

            end if

        end if

    end if



end loop

tells me that you are doing something terribly terribly wrong.

Your initialization code
code:

for i : 1 .. 50
    for j : 1 .. 7
        marks (i, j) := -1
    end for
end for

is wonderful. Use the same for-loop flow to get the marks in. That is, instead of default -1 get the entered mark.


: