Dim Townlists As New List(Of Town)
Private population As Integer
Public Sub New(ByVal N As String, ByVal R As String, ByVal P As Integer)
Public Function getname()
Public Function getregion()
Public Function getpopulation()
Townlists.Add(New Town("suzhou", "JS", 1030039))
Townlists.Add(New Town("wuxi", "JS", 2317298))
Townlists.Add(New Town("Nanjing", "JS", 27836))
For Each item In Townlists
Console.WriteLine("Town name:" & item.getname)
Console.WriteLine("Region:" & item.getregion)
Console.WriteLine("population:" & item.getpopulation)
Console.WriteLine("---------")
Console.WriteLine("press anything to back to menu")
Console.WriteLine("Please give the town name you wanna search")
Dim query As String = Console.ReadLine
For Each item In Townlists
If item.getname = query Then
Console.WriteLine("Region: " & item.getregion)
Console.WriteLine("Population: " & item.getpopulation)
Console.WriteLine("----------")
Console.WriteLine("-------")
Console.WriteLine("Nothing Found")
console.writeline("Give the nanme of the town you want to add")
Dim name as string = console.readline
console.writeline("Give the region of the towb")
Dim region as string = console.readline
console.writeline("Give the population of the town")
Dim popu as integer = console.readline
Townlist.Add(New Town(name,region,popu))
console.writeline(name&" added successfully")
console.writeline("press anything to back to menu")
Console.WriteLine("Please give the region of the town")
Dim query As String = Console.ReadLine
Dim Tlist As new list(of Town)
For Each item In Townlists
If item.getregion = query Then
Tlist.add(new(item.getname,item.getregion,item.getregion))
console.writeline("Nothing found")
console.writeline(item.getname)
console.writeline(item.getregion)
console.writeline(item.getpopulation)
console.writeline("press anything to back to menu")
Function searchbypopulation()
Sub choice(ByVal c As String)
Console.WriteLine("V: view the towns")
Console.WriteLine("A: add information for a town")
Console.WriteLine("N: search a town by its name")
Console.WriteLine("R: search a town by its region")
Console.WriteLine("p: search a town by its population")
Console.WriteLine("D: delet information of a town")
Console.WriteLine("E: exit")
Dim c as string = Console.ReadLine()