You are on page 1of 5

Pseudocode for 1 Dimensional Array

For Number = 0 to 5
Input Employee Name
Output Employee Name
Next Number

Pseudocode For 2-Dimensional Array


Start
For d = 0 to 4
Input Employee Name
For c = 0 to 5
Input employee details
Employee details (d)=employee table(c,d)
Next c
Output Employee Name
Output Employee details
Next d
stop
Interface Design for 1D Array

VB.Net Code for 1D Array


Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


'14/03/24
'One dimensional Array
'Done by Chowa Munyaradzi

Dim EmployeeName(8) As String


Dim Number As Integer
For Number = 0 To 5
EmployeeName(Number) = InputBox("Enter the name of employee") 'Entering
names into the array

ListBox1.Items.Add(EmployeeName(Number)) 'filling the Listbox with information


Next

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


Close() 'To stop the program running
End Sub
End Class
Results for 1D Array
Interface Design for 2D Array

VB.Net Code for 2D Array


Public Class Form2
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim EmployeeName(4) As String
Dim Details(4, 3) As String
Dim Total(3) As String
Dim FNumber, SNumber As Integer
For FNumber = 0 To 4
EmployeeName(FNumber) = InputBox("Enter Employee Name") 'Inputing the names
of the students
For SNumber = 0 To 3
Details(FNumber, SNumber) = InputBox("Enter Employee Details") 'Inputing the
marks
Total(SNumber) = Details(FNumber, SNumber)
Next
ListBox1.Items.Add(EmployeeName(FNumber) & vbTab & Total(0) & vbTab &
Total(1) & vbTab & Total(2) & vbTab & Total(3)) 'Entering informationirnto the ListBox
Next

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


ListBox1.Items.Add("Name" & vbTab & "Department" & vbTab & "Phone number" &
vbTab & "Salary" & vbTab & "Date enrolled") 'Enetring the headings into the ListBox
End Sub

Private Sub Button3_Click_1(sender As Object, e As EventArgs) Handles Button3.Click


End 'Stop running
End Sub
End Class

Results for 1D Array

You might also like