Microsoft Small Basic

Program Listing: CNP907
start:
TextWindow.WriteLine("Find out what day of the week were you born on!")
TextWindow.Write("Enter the day date of your birth: ")
daydate=textwindow.readnumber()
Textwindow.write("Enter the month date of your birth: ")
monthdate=textwindow.readnumber()
TextWindow.Write("Enter the first two figures of the year of your birth: ")
year1=textwindow.ReadNumber()
TextWindow.Write("Enter the second two figures of the year of your birth: ")
year2=textwindow.ReadNumber()
TextWindow.Write("You were born on " + daydate + " " + monthdate + " " + year1 + year2)
TextWindow.Write(". Is this correct (Y/N)? ")
checkdate=textwindow.Read()
If checkdate="n" then
goto start
EndIf
If monthdate=1 Or monthdate=2 Then
monthdate=monthdate+12
year2=year2-1
EndIf
sum=math.Floor(2.6*monthdate-5.39)+math.Floor(year1/4)+math.Floor(year2/4)+daydate+year2-year1*2
daynumber=math.Remainder(sum,7)
If daynumber=0 then
TextWindow.WriteLine("You were born on a Sunday")
elseif daynumber=1 then
TextWindow.WriteLine("You were born on a Monday")
elseif daynumber=2 then
TextWindow.WriteLine("You were born on a Tuesday")
elseif daynumber=3 then
TextWindow.WriteLine("You were born on a Wednesday")
elseif daynumber=4 then
TextWindow.WriteLine("You were born on a Thursday")
elseif daynumber=5 then
TextWindow.WriteLine("You were born on a Friday")
elseif daynumber=6 then
TextWindow.WriteLine("You were born on a Saturday")
EndIf
TextWindow.WriteLine("Would you like to try another date? Y/N")
another=textwindow.Read()
If another="y" then
Goto start
EndIf