![]() |
|
#1
|
||||
|
||||
Trying to create a calendarI have to write a C program which will print yearly calendars, given as input the year numbers. Input data will be taken from a text file, which will contain an unknown number of data lines, each containing a single integer giving a year. For each data line you will first read in the year number.
I was able to write a function for finding the first day of the year: CPP / C++ / C Code:
and another for leap year, CPP / C++ / C Code:
I am having trouble getting it started if anyone could help, thanks Last edited by LuciWiz : 16-Mar-2005 at 23:59.
Reason: Please insert your C code between [c] & [/c] tags
|
||||
|
#2
|
||||
|
||||
|
Quote:
Do your functions work? Did you write a main function to test them? Start by accepting the year from the keyboard and verify you get to the correct day for the year entered. Then ask specific questions about what you are having trouble with. __________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
|
#3
|
||||
|
||||
|
I worked almost all night these last couple of days but I think I finally got it. If anyone has any comments on it please respond.
ELEET CPP / C++ / C Code:
|
|
#4
|
||||
|
||||
|
You need a return in your main function. Other then that everything seems to work to me
__________________
"To argue with a person who has renounced the use of reason is like administering medicine to the dead." -Thomas Paine www.sullivan-county.com/deism.htm |
|
#5
|
||||
|
||||
|
In print_month(), rather than the large switch statement with hard coded values, you can set up two arrays:
CPP / C++ / C Code:
CPP / C++ / C Code:
__________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Interested in helping create an RPG? | crystalattice | Member Announcements, Advertisements & Offers | 16 | 06-May-2005 22:18 |
| How to create integer variables | OETN | FLTK Forum | 4 | 26-Dec-2004 10:04 |
| create forum | bearky | MySQL / PHP Forum | 19 | 23-Oct-2004 17:29 |
| Can't seem to create db | Tigress7 | MySQL / PHP Forum | 3 | 19-Aug-2003 09:19 |
| How do I create JavaScript Links? | JdS | Web Design Forum | 8 | 29-Jan-2003 15:02 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The