Quantcast
Channel: working with arrays - Stack Overflow
Viewing all articles
Browse latest Browse all 2

working with arrays

$
0
0

I am working with Visual Basic and i need to Find the total of each column in the last rowFind the grand total in the last cell(the bottom right corner). I know how to do the total thing for this class. But this subject I am working with Arrays. I am sure if that will work with the arrays or will it. I need to have a total at the bottom for this. I am not to sure on how to do it. So if maybe someone might have website i can read on about or something I would be happy. Thanks.

Again this is what I am suppose to do:Find the total of each column in the last rowFind the grand total in the last cell(the bottom right corner).

Module Module1Sub Main()    Dim sum(5, 4) As Integer    Dim row, col As Integer    Dim total As Integer    For row = 0 To 4        For col = 0 To 3            sum(row, col) = row + col            sum(row, 4) += row + col        Next col    Next row    For row = 0 To 5        For col = 0 To 4            Console.Write(sum(row, col) & vbTab)        Next col        Console.WriteLine()    Next rowEnd Sub

End Module


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images