Calendar Cum Schedular



Operation

The program shows the calendar for the given month and year. It also has an additional functionality. It shows the notes for any particular day and highlights the current date. It can be used as appointment reminder.

 

It starts by taking input from the user. User has to provide the year and month for which he wants to see the calendar. After this the program checks if the entered year is a leap year or not. Then it calculates the number of leap years occurred from 1900 to the entered year. This is used to calculate the total number of days from 1900 to date. This number is divided into 7 days of week. This is how we get the first day of the month. Then the calendar is printed and then the current date is highlighted.

 

The user is shown the notes for the current date. He can navigate through the dates using arrow keys on the NUMERIC KEYPAD. Pressing Enter key the user can enter notes. Using UP/DOWN arrow keys the year can be changed. Using RIGHT/LEFT arrow keys the month changes.

 

Rest of the program is self-explanatory.

 

Function Dictionary

 

void clearArea ( int r1, int c1, int r2, int c2 )

This function clears the area obtained from r1, c1, c2, and c2. It prints space character in the whole area.

 

void center ( char *t, int r, int c1, int c2 )

This function puts the passed text in the center of columns c1 and c2

 

void vlin ( int r1, int r2, int c )

This function draws a vertical line from row r1 to r2 at column c. It uses ASCII character 179 to draw line.

 

void hlin ( int r, int c1, int c2 )

This function draws a horizontal line from column c1 to c2 at row r. It uses ASCII character 205 to draw line.

 

void box ( int r1, int c1, int r2, int c2 )

This function draws box provided the corner coordinates ( c1, r1 ) and ( c2, r2 ). This takes help of functions vline( ) and hline( ).

 

void hilite ( int r, int c )

This function highlights the date whose display coordinates are given.

 

void displaydat( )

This function displays date in the calendar

 

void ygets( )

This function is used to get the notes from user.

 

void cleararry( )

This function clears array, used to store information, when there is a change date or year.

 

void accept ( int d2 )

This function is used by the function ygets( ) to get the note from user

 

void getdata( )

This function is used to load the notes for the current date from the database file "TEXT.DAT"

 

All suggestions are welcome. My email ID is byashdeep@rediffmail.com

 

Download