Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 2D arrays Turing help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rosesanity




PostPosted: 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>



student number (PART 1).t
 Description:

Download
 Filename:  student number (PART 1).t
 Filesize:  6.42 KB
 Downloaded:  124 Time(s)


student number (PART 1).t
 Description:

Download
 Filename:  student number (PART 1).t
 Filesize:  6.43 KB
 Downloaded:  75 Time(s)


student number (PART 1).t
 Description:

Download
 Filename:  student number (PART 1).t
 Filesize:  6.43 KB
 Downloaded:  80 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: