Download - Calender c++
-
8/7/2019 Calender c++
1/26
TERM PAPER
OBJECT ORIENTED PROGRAMMING SYSTEM
CSE202
TOPIC- CALENDAR
SUBMITTED TO : SUBMITTED BY:
SHAISHAV SIR ANURAG KUMAR
ROLL NO- 07
SEC- E1801
REG NO- 10809115
-
8/7/2019 Calender c++
2/26
CONTENTS
1. INTRODUCTION
2. SOURCE CODE
a. A1.cpp It displays the welcome screen. It lets the user enter the date.
b. A2.cpp - It checks for the wrong date if entered.
c. A3.cpp - It checks for the leap year and assigns the correct number of days
in the month to the variable.
d. A4.cpp - It checks for the wrong of February.
e. A5.cpp - It displays the calendar of the month entered by the user.
f. A6.cpp - It displays the day on the date entered by the user.
g. A7.cpp - It links all the programs mentioned above.
h. Calmain.cpp - It is the main program of the project
3. DESCRIPTION OF THE PROGRAMS
4. SCREENSHOTS
a. ENTERING DATE
b. LOADING SCREEN
c. LOADING
d. PRINTING CALENDER AND DAY
-
8/7/2019 Calender c++
3/26
e. ERROR SCREEN INVALID DATE
5. HARDWARE & SOFTWARE REQUIREMENTS
INTRODUCTION
The project of CSE202 is calendar. I have to prepare a software in which we
have to print the month calendar and day of the specific date. This software is
programmed in Turbo c ++. The software is basically designed to print calendar.
This software is very useful for all the sectors. More over this type of software
is very much used today in cell phones and computers etc.
I have used linking of programs in my project. I have made 6 programs for
different operations and then I have linked them all in my 7th program. And after
that I have linked the 7th program to my main program. So all together 7
programs have been linked with the main program. I have declared the variables
globally and then they have been used in all the class.
-
8/7/2019 Calender c++
4/26
SOURCE CODE
A1.cpp
#include
#include
#include
long int n=0,i,z1=0,z2=0,z3=0,r1=0,r2=0,r3=0,d=0,m=0,y=0,nod1=0,j;
long int s=0,p=0,s1=0,p1=0,p2=0,leap=0,lp=0,x=0,days=0,lpg=0,ch=0,st=0;
char w;
class a1
{
public:
virtual void getd();
};
void a1::getd()
{
clrscr();
textcolor(2);
gotoxy(20,4);
cout
-
8/7/2019 Calender c++
5/26
delay(1000);
gotoxy(25,12);
textcolor(2);
coutd>>m>>y;
clrscr();
textcolor(4);
gotoxy(5,10);
w=219;
textcolor(4);
cout
-
8/7/2019 Calender c++
6/26
gotoxy(30,13);
cout
-
8/7/2019 Calender c++
7/26
A2.cpp
#include
#include
#include"a1.cpp"
class a2:public a1
{
public:
void getd();
};
void a2::getd()
{
int j;
if(y
-
8/7/2019 Calender c++
8/26
exit(0);
}
if(m>12||m
-
8/7/2019 Calender c++
9/26
delay(200);
cout
-
8/7/2019 Calender c++
10/26
cout
-
8/7/2019 Calender c++
11/26
A3.cpp
#include
#include
class a3:public a1
{
public:
void getd();
};
void a3::getd()
{
if((y%400==0)||((y%100!=0)&&(y%4==0)))
{
lpg=29;
}
else
{
lpg=28;
}
if((m==2)&&(d>lpg))
{
gotoxy(15,18);
cout
-
8/7/2019 Calender c++
12/26
textcolor(2);
char w;
w=222;
textcolor(2);
cout
-
8/7/2019 Calender c++
13/26
A4.cpp
#include
#include
class a4:public a1
{
public:
void getd();
};
void a4::getd()
{
x=y;
s=y-1900;
p=s*365;
for(i=1900;i
-
8/7/2019 Calender c++
14/26
if((s1==1)||(s1==3)||(s1==5)||(s1==7)||(s1==8)||(s1==10)||(s1==12))
{
p1=p1+31;
}
else if((s1==4)||(s1==6)||(s1==9)||(s1==11))
{
p2=p2+30;
}
else if(s1==2)
{
z1=y%4; z2=y%400; z3=y%100;
if((z2==0)||((z3!=0)&&(z1==0)))
lp=29;
else lp=28;
}
}
}
-
8/7/2019 Calender c++
15/26
A5.cpp
#include
#include
class a5:public a1
{
public:
void getd();
};
void a5::getd()
{
nod1=p1+p2+lp+days+(d-1);
n=nod1%7;
st=p1+p2+lp+days;
ch=st%7;
gotoxy(32,5);
textcolor(9);
switch(m)
{
case 1: cout
-
8/7/2019 Calender c++
16/26
case 10: cout
-
8/7/2019 Calender c++
17/26
}
}
-
8/7/2019 Calender c++
18/26
A6.cpp
#include
#include
class a6:public a1
{
public:
void getd();
};
void a6::getd()
{
gotoxy(20,20);
textcolor(2);
cout
-
8/7/2019 Calender c++
19/26
A7.cpp
#include
#include"a2.cpp"
#include"a3.cpp"
#include"a4.cpp"
#include"a5.cpp"
#include"a6.cpp"
-
8/7/2019 Calender c++
20/26
Calmain.cpp
#include"a7.cpp"
#include
#include
//main function
void main()
{
a1 *ap, ao1;
a2 ao2;
a3 ao3;
a4 ao4;
a5 ao5;
a6 ao6;
ap=&ao1;
ap->getd();
ap=&ao2;
ap->getd();
ap=&ao4;
ap->getd();
ap=&ao3;
ap->getd();
ap=&ao5;
ap->getd();
ap=&ao6;
ap->getd();
getch();
}
-
8/7/2019 Calender c++
21/26
DESCRIPTION OF THE CLASSES CREATED IN THE PROGRAM
Programs Description
A1.cpp It displays the welcome screen. It lets the
user enter the date.
A2.cpp It checks for the wrong date if entered.A3.cpp It checks for the leap year and assigns the
correct number of days in the month to the
variable.
A4.cpp It checks for the wrong of February.
A5.cpp It displays the calendar of the month entered
by the user.
A6.cpp It displays the day on the date entered by the
user.
A7.cpp It links all the classes mentioned above.
Calmain.cpp It is the main program of the project.
-
8/7/2019 Calender c++
22/26
SCREENSHOTS
1. ENTERING DATE
2. LOADING SCREEN
-
8/7/2019 Calender c++
23/26
3. LOADING
4. PRINTING CALENDER AND DAY
-
8/7/2019 Calender c++
24/26
5. ERROR SCREEN INVALID DATE
-
8/7/2019 Calender c++
25/26
HARDWARE & SOFTWARE REQUIREMENTS
1. Borland C++ or Turbo C++ complier required.
2. Minimum PC-XT or PC-AT-286 or PS/2.
3. Operating system:-
DOS (Disk Operating System)
Or
Any Microsoft Windows Operating System or Linux/Unix Operating System
Minimum Version 2.0 for Turbo C++ (TC)
Or
Minimum Version 3.0 for Borland C++(BC) MS-Windows-95 which is optional.
4. RAM(Random Access Memory):-
Minimum 640 kb (kilobytes)
5. Hard Disk:-Minimum 6MB Hard disk for permanent storage of C++ complier and its
related files.
6. One Floppy Disk Drive (1.44 MB).
7. One CD-Drive for C++ complier installation.
8. 80 column monochrome or colour monitor.
-
8/7/2019 Calender c++
26/26
9. Mouse (for Windows Based C++ compiler)
10. One keyboard for Program Editing.