Newbie Needs Help with Arrays
I need some help withinitializing, read in value, & writing valueof Arrays, I am a college staudent and basically i am trying to make a algorithm in visual basic using these pseudocode from a school book. Does anyone know anything about turning these pseudocode into a working Visual basic code.
Basically this psuedocode code is suppose to initialize a one-dimensional
array called List
PSEUDOCODE:Initialize One-Dimensional Array
Start
sub = 0
DOWHILE sub < 10
sub = sub + 1
List(sub)
ENDDO
Stop
Basically this psuedocode code is suppose to Input the value of sub into one-dimensional array called(List)
PSEUDOCODE:Input One-Dimensional Array
Start
sub = 0
DOWHILE sub < 10
sub = sub + 1
READ List(sub)
ENDDO
Stop
Basically this psuedocode code is suppose to write the value of a one-dimensional array called(List)
PSEUDOCODE:Output One-Dimensional Array
Start
sub = 0
DOWHILE sub < 10
sub = sub + 1
WRITE List(sub)
ENDDO
Stop
Basically this is what i came up with but no success each are sepparate program that are meant to run independantly from one another I was just saving time and space, I designed this to just run one at a time by calling each module from the main module.
Module A000
Public sub1 As Integer = 0
Public list As Array
Sub Main()
Call initialize()'these do not run together uncomment to
'call one module at one time
'Call Input()'these do not run together
'Call Output()'these do not run together
End Sub
End ModuleModule B000
Public Function initialize() As Integer
Do While sub1 < 10
sub1 += 1
list(sub1) = 0
Loop
Return sub1
End Function
End ModuleModule B010
Private Function input()
Do While sub1 < 10
sub1 += 1
Loop
Return sub1
End Function
End Module
Module B020
Private Function output()
Do While sub1 < 10
sub1 += 1
Console.WriteLine(list(sub1))
Loop
Return sub1
End Function
End Module

