![]() |
|
#1
|
|||
|
|||
Help with array and function inputI am having to write a program that determines the day number in a year for a date that is provided as input data. Like, if the user inputs January 1st, 2004...the program will output 1. I have some of it written and just can't seem to figure out the formula that computes the data...here is what I have written so far:
CPP / C++ / C Code:
Last edited by dsmith : 12-Apr-2004 at 10:18.
Reason: Please use [c] & [/c] to properly highlight code
|
|
#2
|
||||
|
||||
|
CPP / C++ / C Code:
|
|
#3
|
||||
|
||||
|
Although the colors are pretty, we would prefer your code be within code tags ([c] & [/c]) to preserve your formatting.
CPP / C++ / C Code:
and voila you have the julian date for the year. I'll let you figure out how to do the leap year. __________________
Age is unimportant -- except in cheese |
|
#4
|
|||
|
|||
Thanks...But a little more help?Quote:
I have been doing some more work on this program, with your help....still not getting it to work. Could you take a look at it and give me some more advice? Thanks for any help! CPP / C++ / C Code:
|
|
#5
|
||||
|
||||
|
What is it you want to hear? Please ask a specific question, because I'd rather not look through all that code without knowing what the problem is first!
__________________
-Aaron |
|
#6
|
||||
|
||||
|
In the leap year the only difference is that Feb is 29 days so why don`t u check for leap year out of the loop and change the entry of feb. to 29 if it`s satisfied
and plz ask a specific question as said |
|
#7
|
||||
|
||||
|
You code looks soo long that i refused to look, but on second look, it actually is a same code posted twice. Anyway, this is what I saw in your code.
CPP / C++ / C Code:
Why do you make your leap year code like that : CPP / C++ / C Code:
__________________
When you say "I wrote a program that crashed Windows," people just stare at you blankly and say "Hey, I got those with the system, for free." Linus Torvalds |
|
#8
|
||||
|
||||
|
Quote:
CPP / C++ / C Code:
__________________
Age is unimportant -- except in cheese |
|
#9
|
||||
|
||||
|
Quote:
Yes I know that. Buts isn't enough just like this: CPP / C++ / C Code:
__________________
When you say "I wrote a program that crashed Windows," people just stare at you blankly and say "Hey, I got those with the system, for free." Linus Torvalds |
|
#10
|
|||
|
|||
|
Quote:
No, considering the 'hundred years', there's a leap year only every 400 years. Like there was leap year in 2000, but not in 1900. GF |
Recent GIDBlog
Halfway done! by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Revising Script style ?????? | pepee | MySQL / PHP Forum | 4 | 14-Apr-2004 04:59 |
| need help with passing 3 arrays into a function | tommy69 | C Programming Language | 14 | 07-Apr-2004 00:22 |
| Speed up C++ code about 3d array! | Truong Son | C++ Forum | 0 | 16-Mar-2004 21:52 |
| throwing an struct(with an array) through a function | knakworstje | C Programming Language | 5 | 15-Feb-2004 16:20 |
| deleting from an array | ionyka | C++ Forum | 1 | 02-Sep-2003 03:09 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The