0% found this document useful (0 votes)
99 views23 pages

Kendriya Vidyalaya, Neist: A Computer Science Project

This project develops a calendar system using C++. The program allows a user to input a year and month, then displays the calendar for that month. Key functions include getting the user input, checking for leap years, determining the number of days in each month, and printing the final calendar output. The program breaks the task into separate functions for year and month input, leap year checking, determining start days, and output display to improve efficiency.

Uploaded by

V Srinivasa Rao
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views23 pages

Kendriya Vidyalaya, Neist: A Computer Science Project

This project develops a calendar system using C++. The program allows a user to input a year and month, then displays the calendar for that month. Key functions include getting the user input, checking for leap years, determining the number of days in each month, and printing the final calendar output. The program breaks the task into separate functions for year and month input, leap year checking, determining start days, and output display to improve efficiency.

Uploaded by

V Srinivasa Rao
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

KENDRIYA

VIDYALAYA,
[A COMPUTER
NEIST
SCIENCE PROJECT]
A PROJECT DEVELOPED IN C++

DEVELOPED BY:
DIPANKAR ROY.
CLASS XII (SCI)
CERTIFICATE
This is to certify that this bona fide report of project work titled “CALENDAR
SYSTEM” is prepared by Dipankar Roy of Class XII, session 2010-11 for the
partial fulfillment of Computer Practical Examination of AISSCE 2011
under the guidance of his subject teacher.

This is an authentic project and does not indulge in any sort of plagiarism.

Place: Kendriya Vidyalaya, NEIST,

Jorhat.

Date: _________________

______________________________________

(NARESH KUMAR )

Teacher-in-charge (PGT),

Department of Computer Science.

Submitted to the examiner on practical examination held on _______________.

_____________________________________

(Examiner)

2|Page
PREFACE
This project is a system software developed to keep track of days, dates and
events. Since ancient times, calendars have had a major impact on the lives of
the common man. There are sources of different types of calendars all around
the world. Earlier calendars were based on the movement of sun and the
moon, their periodic rotation and revolution period. But, as we started moving
into the new age of science and beyond. The need for a more reliable and
authentic date system aroused. The rising globalization factors and the
stronghold of the british empire all around the world gave rise to the uniting
factor in the international arena.

This was no different in case of the calendars across the world. The greek,
roman, mayan and all the other calendars across the world, undoubtedly
maintain their individuality, but the Christian calendar of 365 days and 12
months is universally accepted today. A calendar that is accepted worldwide
and has been one of the most important factor in determining events and
festivities. Its independence from the moon and the sun movements make it
more reliable.

This project is an attempt to develop such a calendar, which is a vital


component of this human civilization today. This calendar is an endless one
and gives you the day and the week of the date you have entered.

3|Page
INDEX

S.no. Topic Page no.

1. Title of the project 5

2. Abstract of the project 6

3. Technology used and system requirements 7

4. Functional components 8

5. Data flow diagram. 9

6. Milestones 10

(a) Pre-analysis 10

(b) task-breakup 11

(c) testing and review. 18

7. Sources and references 22

8. What more could have been done on the project 23

4|Page
[CALENDAR To develop a calendar
that can cater to the
needs of the people
SYSTEM] around. A calendar is a
basic social necessity in
everyone’s life. A
system that is needed to
determine and organize
days for all sorts of
social, religious,
commercial or
administrative
purposes. A basic social
need today. That is why
I have given the name of
my project as the
CALENDAR SYSTEM.

ABSTRACT OF
THE PROJECT

This is a project developed in 3GL i.e. third generation


programming language environment. It is developed

5|Page
in C++ language. The project developed is a calendar
system. A system that showcases the calendar of the
month desired by the user. The system interface asks
the user to enter his choice as to whether he wants to
use the calendar or come out of the system. This is a
very effective attempt towards developing a system
which caters to the need of almost every section of this
civilized soul today.

6|Page
TECHNOLOGY

TECHNOLOGY USED:

 BORLAND C++, version 5.02.


 TURBO C++, version 3.0
 WINDOWS 7, ultimate edition.
Microsoft corporation.
 MS Office 2007

SYSTEM REQUIREMENTS:

 A C++ compiler.
(Any of the two compilers mentioned above.)
 A minimum RAM of 64 MB.
 A suitable platform to execute the program
(viz. Windows, DOS,etc.)

7|Page
FUNCTIONAL COMPONENTS
The entire program has been divided into a number of functions for better
coordination and efficiency.

The different functions are discussed below:

a) getyear( ): The user is supposed to enter a valid year to look up for the
month of the year the user.
b) checkleap( ): This function checks whether the year entered is a leap
year or not.
c) monthnameheader( ): This function is a purely a output oriented one.
This function only helps to put the head for the month name.
d) startday( ): This function is logically the most important and the
significant one. This function decides the day of the week in which the
first day of the month of January.
e) monthcount( ): This function decides the number of days in each
month.
f) newmonth( ): This function takes the day of the week in which the
month of January starts as input and decides accordingly, as to on
which day of the week the particular month entered starts on.
g) printall( ): This is the most significant of all the above functions. This
function is the one which gives away the final output of the entire
program.

8|Page
DATA FLOW DIAGRAM

SELECT THE MONTH YOU WANT TO VIEW IN THE CALENDAR

JANUARY FEBRUARY MARCH

APRIL MAY JUNE

JULY AUGUST SEPTEMBER

OCTOBER NOVEMBER DECEMBER

9|Page
MILESTONES
PRE-ANALYSIS

The program developed is that of a calendar system. When the program is run
by the user and is executed. The user is asked to enter the year of the month
he wants to view. As the user enters the year, the compiler will then ask for
the month which the user wants to view from the menu that is put up for
viewing the respective month. On entering the value against the desired
month. The dates with their respective days are displayed on the screen.

A VIEW OF THE CODING OF THE CALENDAR SYSTEM

10 | P a g e
TASK BREAK-UP

The entire program is divided into number of functions for better connectivity
between the functions and also to keep the different tasks separately for
efficient working of the program.

Here in this particular program, a formula has been used which can calculate
and give us a number representing the first day of the first month, i.e. January.
The dates and the starting days of the following months are calculated
accordingly. The entire task has been accomplished by making use of many
iteration statements like the for loop and a few selection statements like those
of switch and if else etc.

Below are a few important functions of the program:

VOID MAIN( )
void main()
{
int counter;
clrscr();
int x;
gotoxy(20,5);
cout<<"**** WELCOME TO THE CALENDAR SYSTEM ****";
gotoxy(25,8);
cout<<"<<< ENTER YOUR CHOICE >>>";
gotoxy(25,9);
cout<<"| 1. calendar: |";
gotoxy(25,10);
cout<<"| 2. exit: |";
gotoxy(25,11);
cout<<"|_________________________|\n";
cin>>x;
if(x==2)
{
exit(0);
}

11 | P a g e
else if(x==1)
{
clrscr();
year= getyear();
}
}

INT GETYEAR( )

int getyear( )
{
int c;
gotoxy(25,4);
cout<<":: ENTER THE YEAR ::\n";
cin>>c;
cout<<"\n\n";
if(c==0)
{
cout<<"\n Enter again:";
}
gotoxy(20,5);
cout<<" ENTER THE MONTH YOU WANT TO VIEW";
gotoxy(25,7);
cout<<"1. january";
gotoxy(25,8);
cout<<"2. february";
gotoxy(25,9);
cout<<"3. march";
gotoxy(25,10);
cout<<"4. april";
gotoxy(25,11);
cout<<"5. may";
gotoxy(25,12);
cout<<"6. june";
gotoxy(25,13);
cout<<"7. july";

12 | P a g e
gotoxy(25,14);
cout<<"8. august";
gotoxy(25,15);
cout<<"9. september";
gotoxy(25,16);
cout<<"10.october";
gotoxy(25,17);
cout<<"11.november";
gotoxy(25,18);
cout<<"12.december\n";
cin>>counter;

year=c;
printall(year);
return year;
}

INT CHECKLEAP( )

int checkleap(int year)


{
if((year%100)==0)
{
if((year%400)==0)
return 1;
}
if(year%4==0)
return 1;
else
return 0;
}

13 | P a g e
VOID MONTHCOUNT( )
void monthcount(int counter)
{
switch(counter)
{
case 1:
strcpy(na,"January");
daysinmonth=31;
break;

case 2:
strcpy(na,"February");
n=checkleap(year);
if(n==1)
{
daysinmonth=29;
s=31;
}
else if(n==0)
{
daysinmonth=28;
s=31;
}
break;

case 3:
strcpy(na,"march");
daysinmonth=31;
s=31+28;
break;

case 4:
strcpy(na,"april");
daysinmonth=30;
s=31+28+31;
break;

14 | P a g e
case 5:
strcpy(na,"may");
daysinmonth=31;
s=31+28+31+30;
break;

case 6:
strcpy(na,"June");
daysinmonth=30;
s=31+28+31+30+31;
break;

case 7:
strcpy(na,"July");
daysinmonth=31;
s=31+28+31+30+31+30;
break;

case 8:
strcpy(na,"august");
daysinmonth=31;
s=31+28+31+30+31+30+31;
break;

case 9:
strcpy(na,"september");
daysinmonth=30;
s=31+28+31+30+31+30+31+31;
break;

case 10:
strcpy("october",na);
daysinmonth=31;
s=31+28+31+30+31+30+31+31+30;
break;

case 11:
strcpy(na,"november");

15 | P a g e
daysinmonth=30;
s=31+28+31+30+31+30+31+31+30+31;
break;

case 12:
strcpy(na,"december");
daysinmonth=31;
s=31+28+31+30+31+30+31+31+30+31+30;
break;
}
}

INT STARTDAY( )

int startday(int year)


{
startdow= (year+(year-1)/4-(year-1)/100+(year-1)/400)%7;
return startdow;
}

VOID PRINTALL( )
void printall(int year)
{
monthnameheader(year);
monthcount(counter);
if(counter==1)
wrap=startday(year);
else
{
wrap=startday(year);
n=checkleap(year);
if(counter>=3)
{
if(n==0)
{

16 | P a g e
for(int i=1; i<=s; ++i)
{
if(wrap==7)
wrap=1;
else
++wrap;
}
}
else
{
for(int i=1; i<=(s+1);++i)
{
if(wrap==7)
wrap=1;
else
++wrap;
}
}
startdow= wrap;
}
cout<<" ";
for(int j=0; j<startdow; j++)
cout<<" ";
for(int daycounter=1; daycounter<=daysinmonth; daycounter++)
{
if(wrap==7)
{
cout<<"\n\n";
wrap=0;
weeknumber++;
}
if(daycounter<10)
cout<<" ";
cout<<daycounter<<" ";
++wrap;}
}
getch();
}

17 | P a g e
TESTING AND REVIEW

When the program is executed, the following screen appears in front of the
user.

The user is supposed to make a choice out of the menu if he/she wants to view
the calendar.

18 | P a g e
On making the choice as ‘1’, i.e. for a calendar, the following screen comes up:

The user has to enter the year of which he/she wants to view the particular
month. For instance say ‘2011’.

19 | P a g e
On entering the above input, the following window appears:

Now the user has to enter the number against the month which the user
wants to view. For instance the user wants to view the month of MARCH. The
user has to type 3.

20 | P a g e
The following output is seen on the screen:

Thus, the calendar for the month of MARCH of the year 2011 can be now
viewed.

21 | P a g e
SOURCES AND REFERENCES

Textbooks:

 The Textbook of Computer Science, class XI


By- Sumita Arora.

 The Textbook of Computer Science, class XII


By- Sumita Arora.

World Wide Web:

 www.google.com

 www.cbseportal.com

 www.goiit.com

22 | P a g e
WHAT MORE COULD
HAVE BEEN DONE

Well nothing is perfect in this world. There always lies a scope of


improvement for everything on this earth. The same is the case with my
project. There could have been a lot many things that could have been
done in this project.

A few of them are listed below:

 A calendar option which could display all the months of the year
together could have been developed.
 Graphic effects and much more could have been done in case of
presentability of the output.
 And a lot more.

Critics are requested to give their opinion on this project. Creative


criticism of every sort is appreciated.

23 | P a g e

You might also like