Professional Documents
Culture Documents
SCIENCE PROJECT
INDEX
BONAFIDE CERTIFICATE.. ACKNOWLEDGEMENTS. ABOUT THE PROJECT. CONCEPTS APPLIED SOURCE CODE OUTPUT SCREEN SHOTS BIBLIOGRAPHY.
BONAFIDE CERTIFICATE
Certified to be the Bonafide Project Work In COMPUTER SCIENCE Done by Kshitij Zutshi of class section Of During the year 2013 to 2014.
Signature of Principle: .
School seal:
Submitted for the Practical Exam held on At. Internal Examiner . External Examiner
ACKNOWLEDGEMENTS
In order to succeed, your desire for success should be greater than your fear of failure. Bill Cosby
On this note, I would like to thank our principal, Smt. LALITHA THIAGARAJAN for her unwavering and whole-hearted support Towards completion of this project. I would like to express my sincere gratitude to my chemistry Mentor Mrs. Uma Arthi, for her vital support, guidance and encouragement-without which this project would not have come forth. I would also like to express my gratitude to the staff of the department of chemistry at D.A.V Senior Secondary School, mogappair for their support during making of the project.
management software which is suited for a wide range of users-end users wanting to keep track of their contacts, corporates who want a management software for their public relation operations, and government administrators who want an easy way to manage large databases. This software is however essentially coded to act as a personal contacts and diary database. To achieve this, the program offers the following different feature sets: Protected user facility: This software is capable of handling large databases but when it comes to security levels the program is equipped with stage wise password protection, to make sure that your data is in secure and credible hands.
Extra file handling options: Keeping in mind the needs of todays users, our program comes with handy file modification, viewing and deleting options Which make it easy for users to access its features better and efficiently, because at the end of the day all we have in mind is customer satisfaction and happiness of service to them by all means! Birthday calendar: The birthday calendar option allows users to view all the birthdays and reminders falling in the month duration specified by the user, yet another innovative concept offered by the software, enabling the user to keep track of events without actually having to remember much! 1 Year calendar: This software also offers this handy tool of an years calendar for quick viewing and helps users to keep track of days and schedules for subsequent days or months.
Other than this the software also implements the standard concepts of database management.
Add records/events
Edit records/events- the entire record or particular details of it.
Deleting records/events
CONCEPTS USED
BINARY FILE OPERATIONS DATA FILE HANDLING DATA STRUCTURES NESTING OF CLASSES
DATA HIDING
SOURCE CODE
/* Program title: personal diary management software v2.1.2 Programmers: A Abhay 12C G.Anish Kumar 12C Kshitij Zutshi 12C15 */
#include<fstream.h> #include<iomanip.h>
struct add_record { char name[100]; char address[100]; char phone[20]; char DOB[30]; char age[10]; char note[500]; char place[50]; char time[15]; int month; int year; int firstday;
};
void password_chk (char * ); void disp(); void modify_record1() { add_record a; int size; int c1,c3,i=0; char ch1; do { clrscr(); cout<<"\t\tWHAT WOULD YOU LIKE TO EDIT??"; cout<<"\n\t1.Edit the whole record"; cout<<"\n\t2.Edit any of the details"; cout<<"\nchoice:"; cin>>c1; if(c1==1) {
ifstream fin1("record.dat",ios::binary);
ofstream fout1("modi.dat",ios::binary); char name1[20]; cout<<"\nEnter the name of the record: "; gets(name1);
cout<<"Name:"; gets(a.name); cout<<"\nEnter Address:"; gets(a.address); cout<<"\nEnter phone number:"; gets(a.phone); cout<<"\nEnter AGE:"; gets(a.age); cout<<"\nEnter Place:"; gets(a.place);
cout<<"\nEnter The Note:"; gets(a.note); cout<<"\nYOUR RECORD HAS BEEN EDITED"; fout1.write((char*)&a,sizeof(a)); } } fin1.close(); fout1.close(); if(!i) cout<<"\ninvalid name"; }
else if(c1==2) { ifstream fin2("record.dat",ios::binary); ofstream fout2("modi.dat",ios::binary); char name2[20]; cout<<"\nEnter the name of the record:"; gets(name2); while(fin2.read((char*)&a,sizeof(a)))
{ if(strcmpi(name2,a.name)==0) { i++; cout<<"\t\tWhat do u wanna edit:"; cout<<"\n\t1.The Name"; cout<<"\n\t2.The Address"; cout<<"\n\t3.The Phone No."; cout<<"\n\t4.Age"; cout<<"\n\t5.Place"; cout<<"\n\t6.Note"; cout<<"\n\tchoice:"; cin>>c3; if(c3==1) { clrscr(); cout<<"\tName:";gets(a.name); fout2.write((char*)&a,sizeof(a)); } else if(c3==2)
clrscr(); cout<<"\tPlace:";gets(a.place);
fout2.write((char*)&a,sizeof(a)); }
else if(c3==6) { clrscr(); cout<<"\tNote:";gets(a.note); fout2.write((char*)&a,sizeof(a)); } } } fin2.close(); fout2.close(); if(!i) cout<<"\ninvalid name"; } else
remove("record.dat"); rename("modi.dat","record.dat"); } void input() { textcolor(BLACK); ofstream fout("record.dat",ios::binary|ios::app); add_record a; char ch; int n; char time[10]; char date[10]; _strdate(date); _strtime(time); do
cout<<"\nName:"; gets(a.name); cout<<"\nEnter Address:"; gets(a.address); cout<<"\nEnter phone number:"; gets(a.phone); strcpy(a.DOB,date); strcpy(a.time,time); cout<<"\nEnter AGE:"; cin>>a.age; cout<<"\nEnter Place:"; gets(a.place); cout<<"\nEnter The Note:"; gets(a.note); cout<<"\nYOUR RECORD HAS BEEN ADDED!!!!";
fout.write((char*)&a,sizeof(a)); cout<<"\nContinue adding more records:"; cin>>ch; }while(ch=='y'); fout.close(); } void output() { int i=0; clrscr(); int a,b,c,d; char cont; do { clrscr(); add_record a; setbkcolor(6); setcolor(4);
cout<<"\n\n\t\tMENU:-\n\t\t----\n\tYou can use any of the below options to view records entered\n\t1.First letter of the name\n\t2.Date\n\t3.Phone number\n\n\tEnter ur choice: ";
cin>>b; if(b==1) { ifstream fin("record.dat",ios::binary); char first; cout<<"\n\n\t\tEnter the first letter: "; cin>>first;
puts(a.phone); cout<<"\nDOB:"; puts(a.DOB); cout<<"\nPLACE:"; puts(a.place); cout<<"\nTIME:"; puts(a.time); cout<<"\nNOTE:"; puts(a.note); cout<<"\nAGE:"<<a.age;
while(fin1.read((char*)&a,sizeof(a))) { if(strcmpi(date,a.DOB)==0) { i++; cout<<"\nNAME:"; puts(a.name); cout<<"\nADDRESS:"; puts(a.address); cout<<"\nPHONE:"; puts(a.phone); cout<<"\nDOB:"; puts(a.DOB); cout<<"\nPLACE:"; puts(a.place);
cout<<"\nTIME:"; puts(a.time); cout<<"\nNOTE:"; puts(a.note); cout<<"\nAGE:"<<a.age; cout<<"\n\nRECORD(s) VIEWED!!!!"; } } fin1.close(); if(!i) cout<<"No records exist or invalid date"; }
else if(b==3) { ifstream fin2("record.dat",ios::binary); int f1=0,f2=0; char pno[10]; cout<<"\nEnter the phone number:"; gets(pno); if(strlen(pno)==10)
f1++; if(strlen(pno)==8) f2++; if(f1||f2) { while(fin2.read((char*)&a,sizeof(a))) { i++; if(strcmpi(a.phone,pno)==0) { cout<<"\nNAME:"; puts(a.name); cout<<"\nADDRESS:"; puts(a.address); cout<<"\nPHONE:"; puts(a.phone); cout<<"\nDOB:"; puts(a.DOB); cout<<"\nPLACE:"; puts(a.place);
void loading() { setbkcolor(BLACK); int left,right,top,bottom; left = getmaxx() / 2 - 286; top = getmaxy() / 2 - 220; right = getmaxx() / 2 + 280; bottom = getmaxy() / 2 + 220; rectangle(left,top,right,bottom); for(int i=200;i<=450;i+=rand()%50) { setfillstyle(5,7); char load[20];setbkcolor(0); setcolor(4);delay(100);settextstyle(TRIPLEX_FONT,0,5); outtextxy(200,150,"LOADING......"); delay(30);bar(200,220,i,230);bar(200,233,450,235); setfillstyle(1,0);bar(200,235,450,278);
void deleterecord() { setbkcolor(6); setcolor(6); ifstream fin("record.dat",ios::binary); if(!fin) cout<<"\n\nnot found"; else { add_record a; char s[80];
int top,bottom,right,left; left = getmaxx() / 2 - 320; top = getmaxy() / 2 - 220; right = getmaxx() / 2 + 298; bottom = getmaxy() / 2 + 220; rectangle(left,top,right,bottom); cout<<"\n\n\t\tEnter Name of the record to be deleted:"; gets(s); ofstream fout("recdel.dat",ios::binary); while(fin.read((char*)&a,sizeof(a))) {
if(strcmpi(s,a.name)==0) {
} fin.close(); fout.close(); } remove("record.dat"); rename("recdel.dat","record.dat"); } void birthday() { int size; int gdriver = DETECT, gmode; int g1driver=DETECT,g1mode=DETECT; int style, midx, midy; initgraph(&gdriver, &gmode, "C:\\TURBOC3\\bgi"); initgraph(&g1driver, &g1mode, "C:\\TURBOC3\\bgi"); ifstream fin1("record.dat",ios::binary); add_record a; int i=0; char date[10]; setbkcolor(BLUE);
while(fin1.read((char*)&a,sizeof(a))) { if(strcmpi(date,a.DOB)==0) { clrscr(); i++; int left,right,top,bottom; left = getmaxx() / 2 - 286; top = getmaxy() / 2 - 220; right = getmaxx() / 2 + 280; bottom = getmaxy() / 2 + 220; rectangle(left,top,right,bottom); for(int j=1;j<=10;j++) { setbkcolor(i);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,size=3);
outtextxy(180,98,"HAPPY BIRTHDAY");
outtextxy(140,138,"
");
outtextxy(140,180,"AGE :"); outtextxy(221,181,a.age); delay(500); } } } fin1.close(); if(!i) cout<<"No records exist or invalid date"; } void setFirstDay() {
//This part determines which day will be the first day of that year (0 for Sunday, 1 for Monday, etc.) int NumberOfDaysInMonth; int FirstDayOfMonth; int DayOfWeekCounter = 0; int DateCounter = 1; int size; char ch; add_record a; do { clrscr(); settextstyle(TRIPLEX_FONT,HORIZ_DIR,size=2); outtextxy(300,40,"..::CALENDAR 2013-14::..");
cin>>a.month; int day=1; int y = a.year - (14-a.month)/12; int m = a.month +12 * ((14-a.month) / 12) -2; a.firstday= (day + y + y / 4 - y / 100 + y / 400 + (31 * m / 12)) % 7; setcolor(RED); switch (a.month) {
case 1: cout<<setw(34)<<"January "<<a.year; NumberOfDaysInMonth = 31; break; case 2: cout<<setw(34)<<"February "<<a.year; if (a.year % 400 == 0 || (a.year % 4 == 0 && a.year % 100 != 0)) NumberOfDaysInMonth = 29; else
NumberOfDaysInMonth = 28; break; case 3: cout<<setw(34)<<"March "<<a.year; NumberOfDaysInMonth = 31; break; case 4: cout<<setw(34)<<"April "<<a.year; NumberOfDaysInMonth = 30; break; case 5: cout<<setw(34)<<"May "<<a.year; NumberOfDaysInMonth = 31; break; case 6: cout<<setw(34)<<"June "<<a.year; NumberOfDaysInMonth = 30; break; case 7: cout<<setw(34)<<"July "<<a.year;
NumberOfDaysInMonth = 31; break; case 8: cout<<setw(34)<<"August "<<a.year; NumberOfDaysInMonth = 31; break; case 9: cout<<setw(34)<<"September "<<a.year; NumberOfDaysInMonth = 30; break; case 10: cout<<setw(34)<<"October "<<a.year; NumberOfDaysInMonth = 31; break; case 11: cout<<setw(34)<<"November "<<a.year; NumberOfDaysInMonth = 30; break; case 12: cout<<setw(34)<<"December "<<a.year;
//Display the days at the top of each month int top,right,left,bottom; left = getmaxx() / 2 - 319; top = getmaxy() / 2 - 220; right = getmaxx() / 2 + 280; bottom = getmaxy() / 2 + 220; rectangle(left,top,right,bottom);
right = getmaxx() / 2 + 131; bottom = getmaxy() / 2 + 90; rectangle(left,top,right,bottom); cout<<"\n\t\tSun Mon Tue Wed Thu Fri Sat";
cout<<"
";
//This loop represents the date display and will continue to run until //the number of days in that month have been reached int tempfirstday=a.firstday;
for (DateCounter; DateCounter <= NumberOfDaysInMonth; ++DateCounter) { cout<<DateCounter<<setw(6); ++DayOfWeekCounter; if (DayOfWeekCounter > 6) { cout<<"\n\n\t\t"<<setw(2); DayOfWeekCounter = 0; } } cout << " \n" ; tempfirstday= DayOfWeekCounter +1; } else cout<<"\n\ninvalid year";
void main() { int gdriver = DETECT, gmode; int g1driver=DETECT,g1mode=DETECT; int style, midx, midy,size; int left, top, right, bottom; textcolor(BLACK); initgraph(&gdriver, &gmode, "C:\\TURBOC3\\bgi"); initgraph(&g1driver, &g1mode, "C:\\TURBOC3\\bgi"); cleardevice(); settextstyle(TRIPLEX_FONT,HORIZ_DIR,size=5); int i; add_record s;
for( i=1;i<=10;i++) { setcolor(i); outtextxy(130,120,"BLACKWATCH DIARY"); delay(200); } clrscr(); settextstyle(TRIPLEX_FONT,HORIZ_DIR,size=2); setbkcolor(CYAN); settextjustify(CENTER_TEXT, CENTER_TEXT); settextstyle(TRIPLEX_FONT, HORIZ_DIR, size=5); setbkcolor(8); setcolor(3); outtextxy(300,50,"COMPUTER SCIENCE PROJECT"); settextstyle(TRIPLEX_FONT, HORIZ_DIR, size=4); outtextxy(350,130,"by A.ABHAY"); outtextxy(380,160,"G.ANISH KUMAR"); outtextxy(410,190,"KSHITIJ ZUTSHI"); delay(400);
char ch1; int n,ch; char temp[100]; char temp2[100]; cleardevice(); loading(); cleardevice(); settextjustify(CENTER_TEXT, CENTER_TEXT); settextstyle(TRIPLEX_FONT, HORIZ_DIR, size=5); setbkcolor(CYAN); outtextxy(300,50,"BLACKWATCH DIARY"); settextstyle(TRIPLEX_FONT, HORIZ_DIR, size=2);
do {
settextjustify(CENTER_TEXT,CENTER_TEXT);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,size=5); clrscr(); cleardevice(); setbkcolor(BLACK); setcolor(RED); int left,top,right,bottom; outtextxy(300,50,"MAIN MENU"); settextstyle(SANS_SERIF_FONT,HORIZ_DIR,size=3); left = getmaxx() / 2 - 296; top = getmaxy() / 2 - 220; right = getmaxx() / 2 + 290; bottom = getmaxy() / 2 + 220; rectangle(left,top,right,bottom); outtextxy(getmaxx()/2.2,getmaxy()/4," 1.ADD RECORD"); outtextxy(getmaxx()/2.2,getmaxy()/3," 2.VIEW RECORD"); outtextxy(getmaxx()/2.2,getmaxy()/2.3," 3.MODIFY RECORD(s)"); outtextxy(getmaxx()/2.2,getmaxy()/1.9," 4.DELETE RECORDS"); outtextxy(getmaxx()/2.2,getmaxy()/1.7," 5.ABOUT BLACKWATCH DIARY"); // rectangle
outtextxy(getmaxx()/2.2,getmaxy()/1.5,"6.BIRTHDAY CALENDAR"); outtextxy(getmaxx()/2.2,getmaxy()/1.3,"7.2013-14 Calendar"); outtextxy(getmaxx()/2.2,getmaxy()/1.2,"8.EXIT"); outtextxy(getmaxx()/2.2,getmaxy()/1.1," ENTER YOUR CHOICE:"); cin>>ch; // window(4,4,80,25);
} else if(ch==2) { clrscr(); cleardevice(); disp(); //closegraph(); setbkcolor(BLACK); char pass[20]; password_chk(pass);
if(strcmpi(pass,"abhay")==0) { modify_record1();
else if(ch==4) {
} else if(ch==5) { clrscr(); setbkcolor(BLACK); left = getmaxx() / 2 - 319; top = getmaxy() / 2 - 225; right = getmaxx() / 2 + 289; bottom = getmaxy() / 2 + 236;
rectangle(left,top,right,bottom); outtextxy(230,80," BLACKWATCH DIARY outtextxy(230,100," ^^^^^^^^^^^^^^^^^^ delay(500); settextjustify(LEFT_TEXT,LEFT_TEXT); settextstyle(SANS_SERIF_FONT,HORIZ_DIR,size=1); outtextxy(0,140,"* This diary app can help you keep track of whatever you want. "); delay(500); outtextxy(0,180,"* You can wish people for their birthdays,festivals,anniversary etc.. " ); delay(500); outtextxy(0,230,"* You can keep track of all the days what incidents happened. "); delay(500); outtextxy(0,250,"* This is a very secure application." ); delay(500); outtextxy(0,270,"* Password needed for accessing any detail."); delay(500); "); ");
outtextxy(0,290,"* This app supports all OS,including ios and android."); delay(500); outtextxy(0,310,"* All your details is at your finger tips"); settextstyle(SANS_SERIF_FONT,HORIZ_DIR,size=3); outtextxy(230,380,"'DESIGNED FOR HUMANS'"); settextstyle(SMALL_FONT,HORIZ_DIR,size=2); outtextxy(280,400,"Copyright(c) Blackwatch Corp. 19962014,All rights reserved."); delay(1000);
else if(ch==7) {
clrscr(); setFirstDay(); }
else if(ch==8) { clrscr(); cleardevice(); setbkcolor(BLACK); int top,bottom,right,left; left = getmaxx() / 2 - 286; top = getmaxy() / 2 - 220; right = getmaxx() / 2 + 280; bottom = getmaxy() / 2 + 220; rectangle(left,top,right,bottom); outtextxy(300,50,"THANK YOU FOR USING BLACKWATCH DIARY"); settextstyle(SANS_SERIF_FONT,HORIZ_DIR,size=3); delay(3000);
getch(); }
void password_chk (char * password) { setcolor(BLUE); settextstyle(1,0,2); outtextxy(150,100,"\t\tENTER THE PASSWORD:"); setcolor(WHITE); for(int j=0,k=280;j<5;j++,k+=10)
void disp() { textcolor(BLACK); setcolor(RED); settextstyle(3,0,1); outtextxy(200+100,30," BLACK WATCH DIARY MANAGEMENT"); outtextxy(200+100,50,"**********************************"); }