Imports System.Collections Module Module3 Sub Main() Dim intStack As Stack = New Stack() Dim i As Integer 'Populate the Stack For i = 0 To 5 intStack.Push((i + 1) * 10) Next i Console.WriteLine("Here are the items in the Stack: ") 'Print each member of the Stack For Each j As Integer In intStack Console.Write("{0} ", j.ToString()) Next j 'Displays the topmost member of the Stack without removing it Console.Write(vbCrLf + "The value of the topmost member is: {0} " + vbCrLf, intStack.Peek().ToString()) 'Removes the topmost item from the Stack and displays the remaining items intStack.Pop() Console.Write("The topmost item has now been removed." + vbCrLf + "Now the remaining members are: ") 'Print each member of the Stack For Each j As Integer In intStack Console.Write("{0} ", j.ToString()) Next j System.Console.ReadKey() End Sub End Module