Dim DayCount As Integer = 0
Dim IsNumeric As Integer = 0
Console.WriteLine("Please enter the number of days of recording the temperature")
DayCount = Console.ReadLine
Dim MidDayTemp(DayCount - 1) As Decimal
Dim MidnightTemp(DayCount - 1) As Decimal
Console.WriteLine("Please enter the midday temperature for every day")
For i = 0 To DayCount - 1
Console.WriteLine("Please enter the midday temperature for the day" &i+1&)
Dim input = Console.ReadLine
If Not IsNumeric(input) Then
Console.WriteLine("Please enter a correct value"&"")
Console.WriteLine("Here are the midday temperatures for each day.")
For i = 0 To DayCount - 1
Console.WriteLine("The midday temperature on day " &i+1& " is " & MidDayTemp(i))
Console.WriteLine("Please enter the Midnight Temperature for each day")
For i = 0 To DayCount - 1
Console.Write("Please enter the midnight temperature for Day " & i + 1 & " ")
Dim MidnightTemp(DayCount - 1) As Decimal
Dim input = Console.ReadLine
If Not IsNumeric(input) Then
Console.Write("Enter a correct value" & " ")
Console.WriteLine("Here are the MidNight Temperature for each day")
For i = 0 To DayCount - 1
Console.WriteLine("The Midnight temperature on day " & i + 1 & " is " & MidnightTemp(i))
For i = 0 To DayCount - 1
dayAvg = total \ DayCount
For i = 0 To DayCount - 1
nightAvg = total \ DayCount
Console.WriteLine("The average temperature for MidDay is : " & dayAvg)
Console.WriteLine("The average temperature for MidNight is : " & nightAvg)