var month, day : int
var months : array 1 .. 12 of string := init ("January", "February", "March", "April", "May", "June", "July", "Augest", "September", "October", "November", "December")
var monthn : array 1 .. 12 of int := init (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
var loc1, loc2 : int := 6
put "Enter month number (ei september = 9)"
get month
cls
put "Enter the number that day one falls on (Sunday = 1, Friday = 6 ext)"
get day
cls
locate (3, maxcol div 2 - (length (months (month)) div 2))
put months (month)
locate (4, 20)
put "SUN MON TUES WED THUR FRI SAT"
if day = 1 then
loc2 := 21
end if
if day = 2 then
loc2 := 27
end if
if day = 3 then
loc2 := 34
end if
if day = 4 then
loc2 := 40
end if
if day = 5 then
loc2 := 46
end if
if day = 6 then
loc2 := 53
end if
if day = 7 then
loc2 := 59
end if
for i : 1 .. monthn (month)
if i - 10 < 0 then
locate (loc1, loc2)
else
locate (loc1, loc2 - 1)
end if
put i ..
day += +1
if day > 7 then
day := 1
loc1 += 2
end if
if day = 1 then
loc2 := 21
end if
if day = 2 then
loc2 := 27
end if
if day = 3 then
loc2 := 34
end if
if day = 4 then
loc2 := 40
end if
if day = 5 then
loc2 := 46
end if
if day = 6 then
loc2 := 53
end if
if day = 7 then
loc2 := 59
end if
end for
|