The Calendar Program
Author |
Message |
GhettoSingh
|
Posted: Mon Jun 09, 2003 8:21 pm Post subject: The Calendar Program |
|
|
Hey everyone,
i'm new here and need some help with this turing program i have been assigned. I have to create a calander for all the months. The user will input the month, the first day of the month and how many days are in that month. The only problem i have is how should i even start this?
Does anyone have any ideas on what i can do.
Thank You all
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
nate
![](http://www.e-lacrosse.com/2004/nll/rock.gif)
|
Posted: Mon Jun 09, 2003 8:25 pm Post subject: If and else |
|
|
Its basically just a bunch of ifs and else's.
var month :string
if month = "December" or month ="12" then
put "There are 31 days in ", month
elsif month ="November" or month ="11" then
put "There are 30 days in ", month
end if
I didn't complete the program but i am sure u get my point!
|
|
|
|
|
![](images/spacer.gif) |
GhettoSingh
|
Posted: Mon Jun 09, 2003 8:26 pm Post subject: (No subject) |
|
|
yeah but it has to display the calander. like a grid or somethin im' not to sure how though
|
|
|
|
|
![](images/spacer.gif) |
GhettoSingh
|
Posted: Mon Jun 09, 2003 8:31 pm Post subject: (No subject) |
|
|
like maybe i was thinking of making one grid and everytime the user enter's a month the title of the grid and the number of days changes. Could anyone help me in doing that? Like just start me off kind of
|
|
|
|
|
![](images/spacer.gif) |
GhettoSingh
|
Posted: Mon Jun 09, 2003 8:48 pm Post subject: (No subject) |
|
|
how come i habe this feelin no one gonna help me lol
|
|
|
|
|
![](images/spacer.gif) |
Mephi
|
Posted: Mon Jun 09, 2003 8:52 pm Post subject: (No subject) |
|
|
make a grid as a picture and put it as your background...then just use Font.Draws to put in the numbers in the right spots...and counted loops
|
|
|
|
|
![](images/spacer.gif) |
GhettoSingh
|
Posted: Mon Jun 09, 2003 8:53 pm Post subject: (No subject) |
|
|
damn i know i know this too Ez of a program to even belong here
very hard for me though
|
|
|
|
|
![](images/spacer.gif) |
JayLo
|
Posted: Mon Jun 09, 2003 8:56 pm Post subject: (No subject) |
|
|
how come i feel like you're cheating.
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
GhettoSingh
|
Posted: Mon Jun 09, 2003 8:57 pm Post subject: (No subject) |
|
|
okay i'm sorry for giving that impression
the admin if he wants can delete this post
sorry guys
|
|
|
|
|
![](images/spacer.gif) |
PaddyLong
|
Posted: Mon Jun 09, 2003 10:08 pm Post subject: (No subject) |
|
|
or if you wanna be "uber doober" (I heard a guy say that once...) you could do some research on the Doomsday Algorithm and just get the year and then make the calendar
I made a program that uses the doomsday algorithm a while ago - it's attached, but unfortunately uncommented
but first, get it working with input information like you're supposed to
I would say, draw a grid that is 7 columns by 6 rows and use that as your base... probably also have a 3d array that is 7 columns by 6 rows and fill it with the dates that match up with them (and like -1 or 0 or something for indexes that are not actually in the month) so like the array for June 2003 would be like
(1,1) := 1 %June first is a monday so the first day of the first week is the day 1
(1,2) := 2
(1,3) := 3
(1,4) := 4
(1,5) := 5
(1,6) := 6
(1,7) := 7
(2,1) := 8
(2,2) := 9
(2,3) := 10
(2,4) := 11
(2,5) := 12
(2,6) := 13
(2,7) := 14
....
(5,1) := 29
(5,2) := 30
(5,3) := 0
(5,4) := 0
(5,5) := 0
(5,6) := 0
(5,7) := 0
etc
to fill the array I would have something like the current day of the week and whenever it gets to 7, put it back to 1 and also something for the current week # and whenever you reset your day of the week to 1, add one to the week # ... and whenever the month ends, reset the week # to 1
then when you go to display it just use a Font.Draw or locatexy to output the numbers into your grid... you should put this into a double for loop so you'd have like
for q : 1..6
for w : 1..7
locatexy (w*sizeofyourboxes, q*sizeofyourboxes)
put monthcalendar (q,w)
end for
end for
I've probably posted too much of how to do this :/ hopefully you can understand what I'm talking about
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
doomsday.t |
Filesize: |
6.78 KB |
Downloaded: |
509 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Prince
![](http://www.angelfire.com/hiphop3/m-unit_hustla/images/fxckpare.jpg)
|
Posted: Tue Jun 10, 2003 10:05 am Post subject: (No subject) |
|
|
|
|
|
|
|
![](images/spacer.gif) |
|
|