Sunday, October 31, 2010

Sunday October 21st 2010


Dim dtCurrent As System.DateTime
Dim iHour As Integer

dtCurrent = dtCurrent.Now()
iHour = dtCurrent.Hour

If (iHour < 12) Then
Console.WriteLine("Good morning!")
ElseIf (iHour >= 12) And (iHour < 18) Then
Console.WriteLine("Good afternoon!")
Else
Console.WriteLine("Good evening!")
End If
Console.ReadLine()




Dim temp As Integer = 32


For i = 1 To temp
If temp <= 32 Then
If temp = 32 Then
Console.WriteLine("temp = 32")
Else
Console.WriteLine("Temp: {0}", temp)
End If
End If
' I added a cool sound effect here just for fun
System.Console.Beep(10 * temp + 40, 7 * temp + 35)

temp = temp - 1
Next i



Dim superString As String

superString = Console.ReadLine()

If superString.Length > 10 Then
Console.WriteLine("Your string is longer than ten")
Else
Console.WriteLine("Your string is less than ten")
End If

Dim length As Integer = superString.Length

For i = 0 To superString.Length - 1
Console.WriteLine(superString.Chars(i))
System.Console.Beep(100 + i * 5 + 40, 100 + i * 4 + 40)

Next

No comments: