Saturday, 15 June 2013

vb.net - I have to make a visual basic program that requests a year and gives a day of the week -



vb.net - I have to make a visual basic program that requests a year and gives a day of the week -

alright i'm making programme requests user input year (2002 example) , gives first tuesday of year.

i have no thought how begin this. can help?

i have no thought how begin this.

you beingness thinking how solve problem, without thinking code @ first. think of different approaches:

loop through days of year (starting jan 1st) until find 1 thursday get date of jan 1st of year. check day of week is. add together number of days between day of week , thursday.

now coding part: datetime construction used represent dates in .net. constructor can used create date specific day, month , year. if take @ documentation datetime, find dayofweek method helpful you.

i hope started!

edit:

to convert user input (a string) integer, utilize parse function.

vb.net visual-studio-2010

No comments:

Post a Comment