Professional Documents
Culture Documents
REGISTRATION NO 21DDT20F1078
CLASS DDT5B S2
You are required to build a one-dimensional array using visual basic .net. Please submit
31, 32, 20, 30, 25, 27, 25, 20, 20, 31, 32, 35, 36, 24, 25, 22, 20
Table 1: Ages
Table 1 shows the age of people who are shopping at the Little Baby Shop. But the ages
are not well organized.Therefore, the management team asks you to help them arranges
the information according to these criteria:
1. Ascending Order
2. Show older age
3. Show younger age
4. Average of age
Form1(Q1)
Now click the button “Show older age”, the list box will clear the data about ascending order
and show out the older customer’s age.
Click the button “Show younger age”, the list box will clear the data about older customer’s
age and show out the younger customer’s age.
Click the button “Average of age”, the list box will clear the data about younger customer’s
age and show out customer’s average age.
Coding(Form1(Q1))
Public Class Form1
Dim ages As Integer() = {31, 32, 20, 30, 25, 27, 25, 20, 20, 31, 32,
35, 36, 24, 25, 22, 20}
Array.Sort(ages)
Show.Items.Add(ages(i))
Next
End Sub
Show.Items.Clear()
old = ages(i)
End If
Next
Show.Items.Add(old)
End Sub
Show.Items.Clear()
young = ages(i)
End If
Next
Show.Items.Add(young)
End Sub
Show.Items.Clear()
sum += ages(i)
Next
Show.Items.Add(sum)
End Sub
End Class
Question 2: Array : Two-Dimensional [ 25 marks]
A treasurer wants to list out the person that paid or unpaid for the fees for year 2021
and 2022 as in Table 2 by usingtwo dimensional arrays. Construct Windows Application
program with array – two-dimensional coding that show thestatus of paid and unpaid
person using message box. Please submit you answer with complete form interface and
program code.
Coding(Form1(Q2))
Public Class Form1
For x = 0 To 4
For y = 0 To 2
Next
Next
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
End Sub
End Class