0% found this document useful (0 votes)
76 views

Coding

This document contains the source code for a courier management system written in C programming language. The code includes functions for a main menu with options to add, modify, delete or view consignment details. It also has functions for delivery management, report generation and exiting the program. The code uses structures to store consignment details, files to save records and graphics functions for output display.

Uploaded by

NaMan SeThi
Copyright
© © All Rights Reserved
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)
76 views

Coding

This document contains the source code for a courier management system written in C programming language. The code includes functions for a main menu with options to add, modify, delete or view consignment details. It also has functions for delivery management, report generation and exiting the program. The code uses structures to store consignment details, files to save records and graphics functions for output display.

Uploaded by

NaMan SeThi
Copyright
© © All Rights Reserved
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/ 53

CODING

#include<graphics.h> #include<c:\co2main.c> main() { /*you have to execute courcode.c first time before using this project only at once*/ int gd=DETECT,gm; clrscr(); initgraph(&gd,&gm,""); setbkcolor(BLUE); setcolor(YELLOW); settextstyle(7,0,2); outtextxy(200,5,"PROJECT REPORT"); outtextxy(270,40,"ON"); outtextxy(220,230,"MLN COLLEGE"); outtextxy(215,260,"YAMUNA NAGAR"); outtextxy(250,110,"FOR "); outtextxy(120,140," XYZ COURIER, DELHI"); outtextxy(220,355,"PRIYA MEHTA"); outtextxy(190,380,"B.Com.-III(COMP. APP.)"); settextstyle(3,0,4); setcolor(YELLOW); outtextxy(90,70,"COURIER MANAGEMENT SYSTEM"); settextstyle(1,0,2);

outtextxy(220,200,"SUBMITTED TO:"); outtextxy(230,330,"SUBMITTED BY:"); getch(); closegraph(); textcolor(1); textbackground(6); co2main(); return(0); }

#include<c:\co3main.c> #include<c:\co4main.c> #include<c:\co5main.c> #include<stdio.h> #include<conio.h> #include<graphics.h> co2main() { //char ch[4]; int gd=DETECT,gm,ans; clrscr(); initgraph(&gd,&gm,""); setbkcolor(RED); settextstyle(1,0,4); outtextxy(225,100,"COURIER"); outtextxy(150,160,"MANAGEMENT SYSTEM"); outtextxy(200,220,"DEVELOPED BY"); settextstyle(1,0,6); outtextxy(130,280,"PRIYA MEHTA"); getch(); closegraph(); n1: clrscr(); gotoxy(25,6); printf("=========MAIN MENU========="); gotoxy(25,8);

printf("1.:-CONSIGNMENT MENU"); gotoxy(25,10); printf("2.:-REPORT MENU"); gotoxy(25,12); printf("3.:-CONSIGNMENT DELIVERY"); gotoxy(25,14); printf("4.:-QUIT MENU"); gotoxy(25,16); printf("SELECT ANY ONE:"); gotoxy(25,18); printf("ENTER YOUR CHOICE:"); scanf("%d",&ans); switch(ans) { case 1:co3main(); break; case 2:co4main(); break; case 3:co5main(); break; case 4:textbackground(BLACK); textcolor(WHITE); clrscr(); exit(0); break; default:gotoxy(20,20); printf("CHOICE NOT AVAILABLE");

getch(); } goto n1; }

#include<c:\co31.c> #include<c:\co32.c> #include<c:\co33.c> #include<stdio.h> #include<conio.h> co3main() { int an; n1: clrscr(); gotoxy(30,6); printf("CONSIGNMENT MENU"); gotoxy(25,10); printf("1.:ADDITION OF CONSIGNMENT"); gotoxy(25,11); printf("2.:MODIFICATION OF CONSIGNMENT"); gotoxy(25,12); printf("3.:DELETION OF CONSIGNMENT"); gotoxy(25,14); printf("4.:EXIT TO MAIN MENU"); gotoxy(25,18); printf("SELECT ANY ONE:"); scanf("%d",&an); switch(an) { case 1:co31main(); break;

case 2:co32main(); break; case 3:co33main(); break; case 4:return 1; default:gotoxy(20,20); printf("CHOICE NOT AVAILABLE"); getch(); } goto n1; }

#include<c:\co41.c> #include<c:\co42.c> #include<c:\co43.c> #include<c:\co44.c> #include<stdio.h> #include<conio.h> co4main() { int an; n1: clrscr(); gotoxy(30,6); printf("REPORT MENU"); gotoxy(25,10); printf("1.:SINGLE CONSIGNMENT ENQUIRY"); gotoxy(25,11); printf("2.:TOTAL CONSIGNMENT REPORT"); gotoxy(25,12); printf("3.:DELIVERED CONSIGNMENT REPORT"); gotoxy(25,13); printf("4.:NON-DELIVERED CONSIGNMENT METHOD"); gotoxy(25,14); printf("5.:EXIT TO MAIN MENU"); gotoxy(25,18); printf("SELECT ANY ONE:"); scanf("%d",&an); switch(an)

{ case 1:co41main(); break; case 2:co42main(); break; case 3:co44main(); break; case 4:co43main(); break; case 5:return 1; default:gotoxy(20,20); printf("CHOICE NOT AVAILABLE"); getch(); } goto n1; }

//customer delivery #include<stdio.h> #include<dos.h> #include<conio.h> co5main() { FILE *ds,*fs,*ssf; struct cust { int conno; long int teleno,ateleno; float wt,amt; char cname[20],address[20],city[15],type,aname[20],aaddress[20],acity[15]; int dd,mm,yyyy,hour,min,sec; } cus,cusm; int con,p; char count='y',choice; while(count=='y'||count=='Y') { clrscr(); p=0; gotoxy(25,2); printf("DELIVERY MENU"); gotoxy(5,4); printf("ENTER CONSIGNMENT NUMBER:"); scanf("%d",&con); fs=fopen("add1.dat","rb");

ssf=fopen("temp.dat","ab"); while(fread(&cus,sizeof(cus),1,fs)) { if (cus.conno==con) { p++; gotoxy(5,6); printf("SENDER'S NAME/DEPT.:"); puts(cus.cname); gotoxy(5,7); printf("ADDRESS:"); puts(cus.address); gotoxy(40,7); printf("CITY:"); puts(cus.city); gotoxy(5,8); printf("PHONE NO.:%ld",cus.teleno); gotoxy(40,8); printf("CONSIGNMENT TYPE:[L/P]:%c",cus.type); gotoxy(5,9); printf("DATE IS:[DD MM YYYY]:%d %d %d",cus.dd,cus.mm,cus.yyyy); gotoxy(40,9); printf("AMOUNT:%f",cus.amt); gotoxy(5,10); printf("WEIGHT:%f",cus.wt); gotoxy(40,10);

printf("TIME IS:[HH:MM:SS]:%d:%d:%d",cus.hour,cus.min,cus.sec); gotoxy(5,12); printf("ADDRESSEE'S NAME:"); puts(cus.aname); gotoxy(50,12); printf("ADDRESS:"); puts(cus.aaddress); gotoxy(5,13); printf("CITY:"); puts(cus.acity); gotoxy(50,13); printf("PHONE NO.:%ld",cus.ateleno); gotoxy(5,15); } else {fwrite(&cus,sizeof(cus),1,ssf);} } fclose(fs); fclose(ssf); if (p==0) { gotoxy(10,15); printf("THIS CONSIGNMENT NUMBER DOESN'T EXIST OR ALREADY DELIVERED"); } else {

printf("CONSIGNMENT DELIVERED :[INFORMATION CORRECT:"); scanf("%s",&choice); if (choice=='y'||choice=='Y') { fs=fopen("add1.dat","rb"); while(fread(&cus,sizeof(cus),1,fs)) if (cus.conno==con) { ds=fopen("deladd.dat","ab"); fwrite(&cus,sizeof(cus),1,ds); fclose(ds); } fclose(fs); remove("add1.dat"); rename("temp.dat","add1.dat"); } else remove("temp.dat"); } gotoxy(20,20); printf("DELIVER MORE ENTRY:"); scanf("%s",&count); } getch(); return(0); } //customer addition

#include<stdio.h> #include<dos.h> #include<conio.h> co31main() { FILE *temp,*mas,*fs,*sf; struct date d; struct time t; struct cust { int conno; long int teleno,ateleno; float wt,amt; char cname[20],address[20],city[15],type,aname[20],aaddress[20],acity[15]; int dd,mm,yyyy,hour,min,sec; } cus; int con=0,ab; char ch,count='y'; while(count=='y'||count=='Y') { clrscr(); temp=fopen("courcode","rb"); fread(&con,sizeof(con),1,temp); fclose(temp); con++; cus.conno=con; gotoxy(25,2);

printf("CONSIGNMENT ADDITION"); gotoxy(5,5); printf("CON. NO. IS:%d",cus.conno); gotoxy(22,5); printf("ENTER SENDER'S NAME/DEPT.:"); gets(cus.cname); gets(cus.cname); gotoxy(5,6); printf("ENTER ADDRESS:"); gets(cus.address); gotoxy(45,6); printf("ENTER CITY:"); gets(cus.city); gotoxy(5,7); printf("ENTER PHONE NO.:"); scanf("%ld",&cus.teleno); gotoxy(40,7); printf("ENTER CONSIGNMENT TYPE:[L/P]:"); scanf("%s",&cus.type); if (cus.type=='l'||cus.type=='L'||cus.type=='p'||cus.type=='P') { getdate(&d); cus.dd=d.da_day; cus.mm=d.da_mon; cus.yyyy=d.da_year; gotoxy(5,8); printf("DATE IS:[DD MM YYYY]:%d %d %d",cus.dd,cus.mm,cus.yyyy);

gettime(&t); cus.hour=t.ti_hour; cus.min=t.ti_min; cus.sec=t.ti_sec; gotoxy(40,8); printf("ENTER AMOUNT:"); scanf("%f",&cus.amt); gotoxy(5,9); printf("ENTER WEIGHT:"); scanf("%f",&cus.wt); gotoxy(40,9); printf("TIME IS:[HH:MM:SS]:%d:%d:%d",cus.hour,cus.min,cus.sec); gotoxy(5,12); printf("ENTER ADDRESSEE'S NAME:"); gets(cus.aname); gets(cus.aname); gotoxy(48,12); printf("ENTER ADDRESS:"); gets(cus.aaddress); gotoxy(5,13); printf("ENTER CITY:"); gets(cus.acity); gotoxy(47,13); printf("ENTER PHONE NO.:"); scanf("%ld",&cus.ateleno); gotoxy(5,15); printf("Our Liability For Any Loss Or Damage To The Shipment Is Only Rs. 100/- Only");

gotoxy(10,17); printf("INFORMATION CORRECT:[Y/N]:"); scanf("%s",&ch); if (ch=='y'||ch=='Y') { temp=fopen("courcode","wb"); fwrite(&cus.conno,sizeof(cus.conno),1,temp); fclose(temp); sf=fopen("add1.dat","ab"); fwrite(&cus,sizeof(cus),1,sf); fclose(sf); mas=fopen("addmas.dat","ab"); fwrite(&cus,sizeof(cus),1,mas); fclose(mas); }} else { gotoxy(20,18); printf("NOT VALID TYPE"); } gotoxy(20,22); printf("ADD MORE ENTRY:"); scanf("%s",&count); }return(0); } //customer modification #include<stdio.h>

#include<dos.h> #include<conio.h> co32main() { FILE *mas,*fs; struct cust { int conno; long int teleno,ateleno; float wt,amt; char cname[20],address[20],city[15],type,aname[20],aaddress[20],acity[15]; int dd,mm,yyyy,hour,min,sec; } cus,cusm; int con,p=0; char count='y',ch,choice; while(count=='y'||count=='Y') { clrscr(); gotoxy(25,2); printf("CONSIGNMENT MODIFICATION"); gotoxy(5,4); printf("ENTER CONSIGNMENT NUMBER:"); scanf("%d",&con); fs=fopen("add1.dat","rb+"); while(fread(&cus,sizeof(cus),1,fs)) { if (cus.conno==con)

{ p=1; gotoxy(25,5); printf("SENDER'S NAME/DEPT.:"); puts(cus.cname); gotoxy(5,6); printf("ADDRESS:"); puts(cus.address); gotoxy(40,6); printf("CITY:"); puts(cus.city); gotoxy(5,7); printf("PHONE NO.:%ld",cus.teleno); gotoxy(40,7); printf("CONSIGNMENT TYPE:[L/P]:%c",cus.type); gotoxy(5,8); printf("DATE IS:[DD MM YYYY]:%d %d %d",cus.dd,cus.mm,cus.yyyy); gotoxy(40,8); printf("AMOUNT:%f",cus.amt); gotoxy(5,9); printf("WEIGHT:%f",cus.wt); gotoxy(40,9); printf("TIME IS:[HH:MM:SS]:%d:%d:%d",cus.hour,cus.min,cus.sec); gotoxy(5,12); printf("ADDRESSEE'S NAME:"); puts(cus.aname); gotoxy(45,12);

printf("ADDRESS:"); puts(cus.aaddress); gotoxy(5,13); printf("CITY:"); puts(cus.acity); gotoxy(45,13); printf("PHONE NO.:%ld",cus.ateleno); gotoxy(5,15); printf("DO YOU WANT TO MODIFY THIS RECORD:"); scanf("%s",&choice); if (choice=='y'||choice=='Y') { clrscr(); gotoxy(25,2); printf("CONSIGNMENT MODIFICATION"); gotoxy(5,5); printf("CON. NO. IS:%d",con); gotoxy(22,5); printf("ENTER SENDER'S NAME/DEPT.:"); gets(cus.cname); gets(cus.cname); gotoxy(5,6); printf("ENTER ADDRESS:"); gets(cus.address); gotoxy(45,6); printf("ENTER CITY:"); gets(cus.city);

gotoxy(5,7); printf("ENTER PHONE NO.:"); scanf("%ld",&cus.teleno); gotoxy(40,7); printf("ENTER CONSIGNMENT TYPE:[L/P]:"); scanf("%s",&cus.type); gotoxy(5,8); printf("DATE IS:[DD MM YYYY]:%d %d %d",cus.dd,cus.mm,cus.yyyy); gotoxy(40,8); printf("ENTER AMOUNT:"); scanf("%f",&cus.amt); gotoxy(5,9); printf("ENTER WEIGHT:"); scanf("%f",&cus.wt); gotoxy(40,9); printf("TIME IS:[HH:MM:SS]:%d:%d:%d",cus.hour,cus.min,cus.sec); gotoxy(5,12); printf("ENTER ADDRESSEE'S NAME:"); gets(cus.aname); gets(cus.aname); gotoxy(50,12); printf("ENTER ADDRESS:"); gets(cus.aaddress); gotoxy(5,13); printf("ENTER CITY:"); gets(cus.acity); gotoxy(50,13);

printf("ENTER PHONE NO.:"); scanf("%ld",&cus.ateleno); gotoxy(5,15); printf("Our Liability For Any Loss Or Damage To The Shipment Is Only Rs. 100/- Only"); gotoxy(10,17); printf("INFORMATION CORRECT:[Y/N]:"); scanf("%s",&ch); if (ch=='y'||ch=='Y') { fseek(fs,-141,SEEK_CUR); fwrite(&cus,sizeof(cus),1,fs); mas=fopen("addmas.dat","rb+"); while(fread(&cusm,sizeof(cusm),1,mas)) if (cusm.conno==con) { fseek(mas,-141,SEEK_CUR); fwrite(&cus,sizeof(cus),1,mas); } } } } } if (p==0) { gotoxy(10,15); printf("THIS CONSIGNMENT NUMBER DOESN'T EXIST OR DELIVERED"); getch();

} fclose(fs); fclose(mas); gotoxy(20,20); printf("MODIFY MORE ENTRY:"); scanf("%s",&count); } return(0); }

//customer deletion #include<stdio.h> #include<dos.h> #include<conio.h> co33main() { FILE *mas,*temas,*fs,*ssf; struct cust { int conno; long int teleno,ateleno; float wt,amt; char cname[20],address[20],city[15],type,aname[20],aaddress[20],acity[15]; int dd,mm,yyyy,hour,min,sec; } cus,cusm; int con,p; char count='y',choice; while(count=='y'||count=='Y') { clrscr(); p=0; gotoxy(25,2); printf("CONSIGNMENT DELETION"); gotoxy(5,4); printf("ENTER CONSIGNMENT NUMBER:"); scanf("%d",&con); fs=fopen("add1.dat","rb");

while(fread(&cus,sizeof(cus),1,fs)) if (cus.conno==con) { p++; gotoxy(5,6); printf("SENDER'S NAME/DEPT.:"); puts(cus.cname); gotoxy(5,7); printf("ADDRESS:"); puts(cus.address); gotoxy(40,7); printf("CITY:"); puts(cus.city); gotoxy(5,8); printf("PHONE NO.:%ld",cus.teleno); gotoxy(40,8); printf("CONSIGNMENT TYPE:[L/P]:%c",cus.type); gotoxy(5,9); printf("DATE IS:[DD MM YYYY]:%d %d %d",cus.dd,cus.mm,cus.yyyy); gotoxy(40,9); printf("AMOUNT:%f",cus.amt); gotoxy(5,10); printf("WEIGHT:%f",cus.wt); gotoxy(40,10); printf("TIME IS:[HH:MM:SS]:%d:%d:%d",cus.hour,cus.min,cus.sec); gotoxy(5,12); printf("ADDRESSEE'S NAME:");

puts(cus.aname); gotoxy(50,12); printf("ADDRESS:"); puts(cus.aaddress); gotoxy(5,13); printf("CITY:"); puts(cus.acity); gotoxy(50,13); printf("PHONE NO.:%ld",cus.ateleno); gotoxy(5,15); } fclose(fs); if (p==0) { gotoxy(10,15); printf("THIS CONSIGNMENT NUMBER DOESN'T EXIST OR DELIVERED"); } else { printf("DO YOU WANT TO DELETE THIS RECORD:"); scanf("%s",&choice); if (choice=='y'||choice=='Y') { mas=fopen("addmas.dat","rb+"); temas=fopen("tempmas.dat","ab"); while(fread(&cusm,sizeof(cusm),1,mas)) if (cusm.conno!=con)

fwrite(&cusm,sizeof(cusm),1,temas); fclose(mas); fclose(temas); remove("addmas.dat"); rename("tempmas.dat","addmas.dat"); fs=fopen("add1.dat","rb"); ssf=fopen("temp.dat","ab"); while(fread(&cus,sizeof(cus),1,fs)) if (cus.conno!=con) fwrite(&cus,sizeof(cus),1,ssf); fclose(fs); fclose(ssf); remove("add1.dat"); rename("temp.dat","add1.dat"); } else remove("temp.dat"); } gotoxy(20,20); printf("DELETE MORE ENTRY:"); scanf("%s",&count); } getch(); return(0); }

//customer enquiry single #include<stdio.h> #include<dos.h> #include<conio.h> co41main() { FILE *fs; struct cust { int conno; long int teleno,ateleno; float wt,amt; char cname[20],address[20],city[15],type,aname[20],aaddress[20],acity[15]; int dd,mm,yyyy,hour,min,sec; } cus; int con,p; char count='y'; while(count=='y'||count=='Y') { clrscr(); p=0; gotoxy(25,2); printf("ENQUIRY SINGLE CONSIGNMENT"); gotoxy(5,4); printf("ENTER CONSIGNMENT NUMBER:"); scanf("%d",&con); fs=fopen("add1.dat","rb");

while(fread(&cus,sizeof(cus),1,fs)) { if (cus.conno==con) { p++; gotoxy(5,6); printf("SENDER'S NAME/DEPT.:"); puts(cus.cname); gotoxy(5,7); printf("ADDRESS:"); puts(cus.address); gotoxy(40,7); printf("CITY:"); puts(cus.city); gotoxy(5,8); printf("PHONE NO.:%ld",cus.teleno); gotoxy(40,8); printf("CONSIGNMENT TYPE:[L/P]:%c",cus.type); gotoxy(5,9); printf("DATE IS:[DD MM YYYY]:%d %d %d",cus.dd,cus.mm,cus.yyyy); gotoxy(40,9); printf("AMOUNT:%f",cus.amt); gotoxy(5,10); printf("WEIGHT:%f",cus.wt); gotoxy(40,10); printf("TIME IS:[HH:MM:SS]:%d:%d:%d",cus.hour,cus.min,cus.sec); gotoxy(5,12);

printf("ADDRESSEE'S NAME:"); puts(cus.aname); gotoxy(50,12); printf("ADDRESS:"); puts(cus.aaddress); gotoxy(5,13); printf("CITY:"); puts(cus.acity); gotoxy(50,13); printf("PHONE NO.:%ld",cus.ateleno); gotoxy(5,15); } } fclose(fs); if (p==0) { gotoxy(10,15); printf("THIS CONSIGNMENT NUMBER DOESN'T EXIST"); } gotoxy(20,20); printf("ENQUIRY MORE ENTRY:"); scanf("%s",&count); } getch(); return(0); }

//report of total consignment #include<stdio.h> #include<dos.h> #include<conio.h> co42main() { FILE *fs; struct cust { int conno; long int teleno,ateleno; float wt,amt; char cname[20],address[20],city[15],type,aname[20],aaddress[20],acity[15]; int dd,mm,yyyy,hour,min,sec; } cus; int p; fs=fopen("addmas.dat","rb"); clrscr(); gotoxy(28,3); printf("REPORT OF TOTAL CONSIGNMENT"); gotoxy(1,5); printf("SRNO"); gotoxy(6,5); printf("SEN_NAME"); gotoxy(5,6); printf("ADDRESS & CITY"); gotoxy(28,5);

printf("PHNO"); gotoxy(35,5); printf("TYPE"); gotoxy(40,5); printf("DATE"); gotoxy(50,5); printf("ADD_NAME"); gotoxy(49,6); printf("ADDRESS & CITY"); gotoxy(72,5); printf("PHNO"); p=8; while(fread(&cus,sizeof(cus),1,fs)) { gotoxy(1,p); printf("%d",cus.conno); gotoxy(6,p); puts(cus.cname); gotoxy(5,p+1); puts(cus.address); gotoxy(5,p+2); puts(cus.city); gotoxy(28,p); printf("%ld",cus.teleno); gotoxy(35,p); printf("%c",cus.type); gotoxy(40,p);

printf("%d-%d-%d",cus.dd,cus.mm,cus.yyyy); gotoxy(50,p); puts(cus.aname); gotoxy(49,p+1); puts(cus.aaddress); gotoxy(49,p+2); puts(cus.acity); gotoxy(72,p); printf("%ld",cus.ateleno); p=p+4; if (p>=23) { p=8; getch(); clrscr(); gotoxy(28,3); printf("REPORT OF TOTAL CONSIGNMENT"); gotoxy(1,5); printf("SRNO"); gotoxy(6,5); printf("SEN_NAME"); gotoxy(5,6); printf("ADDRESS & CITY"); gotoxy(28,5); printf("PHNO"); gotoxy(35,5); printf("TYPE");

gotoxy(40,5); printf("DATE"); gotoxy(50,5); printf("ADD_NAME"); gotoxy(49,6); printf("ADDRESS & CITY"); gotoxy(72,5); printf("PHNO"); } } fclose(fs); getch(); return(0); }

//report of non-delivered consignment #include<stdio.h> #include<dos.h> #include<conio.h> co43main() { FILE *fs; struct cust { int conno; long int teleno,ateleno; float wt,amt; char cname[20],address[20],city[15],type,aname[20],aaddress[20],acity[15]; int dd,mm,yyyy,hour,min,sec; } cus; int p; fs=fopen("add1.dat","rb"); clrscr(); gotoxy(20,3); printf("REPORT OF TOTAL CONSIGNMENT(NON-DELIVERED) "); gotoxy(1,5); printf("SRNO"); gotoxy(6,5); printf("SEN_NAME"); gotoxy(5,6); printf("ADDRESS & CITY"); gotoxy(28,5);

printf("PHNO"); gotoxy(35,5); printf("TYPE"); gotoxy(40,5); printf("DATE"); gotoxy(50,5); printf("ADD_NAME"); gotoxy(49,6); printf("ADDRESS & CITY"); gotoxy(72,5); printf("PHNO"); p=8; while(fread(&cus,sizeof(cus),1,fs)) { gotoxy(1,p); printf("%d",cus.conno); gotoxy(6,p); puts(cus.cname); gotoxy(5,p+1); puts(cus.address); gotoxy(5,p+2); puts(cus.city); gotoxy(28,p); printf("%ld",cus.teleno); gotoxy(35,p); printf("%c",cus.type); gotoxy(40,p);

printf("%d-%d-%d",cus.dd,cus.mm,cus.yyyy); gotoxy(50,p); puts(cus.aname); gotoxy(49,p+1); puts(cus.aaddress); gotoxy(49,p+2); puts(cus.acity); gotoxy(72,p); printf("%ld",cus.ateleno); p=p+4; if (p>=23) { p=8; getch(); clrscr(); gotoxy(20,3); printf("REPORT OF TOTAL CONSIGNMENT(non-delivered)"); gotoxy(1,5); printf("SRNO"); gotoxy(6,5); printf("SEN_NAME"); gotoxy(5,6); printf("ADDRESS & CITY"); gotoxy(28,5); printf("PHNO"); gotoxy(35,5); printf("TYPE");

gotoxy(40,5); printf("DATE"); gotoxy(50,5); printf("ADD_NAME"); gotoxy(49,6); printf("ADDRESS & CITY"); gotoxy(72,5); printf("PHNO"); } } fclose(fs); getch(); return(0); }

//report of total delivered consignment #include<stdio.h> #include<dos.h> #include<conio.h> co44main() { FILE *ds; struct cust { int conno; long int teleno,ateleno; float wt,amt; char cname[20],address[20],city[15],type,aname[20],aaddress[20],acity[15]; int dd,mm,yyyy,hour,min,sec; } cus; int p; ds=fopen("deladd.dat","rb"); clrscr(); gotoxy(20,3); printf("REPORT OF TOTAL CONSIGNMENT(DELIVERED)"); gotoxy(1,5); printf("SRNO"); gotoxy(6,5); printf("SEN_NAME"); gotoxy(5,6); printf("ADDRESS & CITY"); gotoxy(28,5);

printf("PHNO"); gotoxy(35,5); printf("TYPE"); gotoxy(40,5); printf("DATE"); gotoxy(50,5); printf("ADD_NAME"); gotoxy(49,6); printf("ADDRESS & CITY"); gotoxy(72,5); printf("PHNO"); p=8; while(fread(&cus,sizeof(cus),1,ds)) { gotoxy(1,p); printf("%d",cus.conno); gotoxy(6,p); puts(cus.cname); gotoxy(5,p+1); puts(cus.address); gotoxy(5,p+2); puts(cus.city); gotoxy(28,p); printf("%ld",cus.teleno); gotoxy(35,p); printf("%c",cus.type); gotoxy(40,p);

printf("%d-%d-%d",cus.dd,cus.mm,cus.yyyy); gotoxy(50,p); puts(cus.aname); gotoxy(49,p+1); puts(cus.aaddress); gotoxy(49,p+2); puts(cus.acity); gotoxy(72,p); printf("%ld",cus.ateleno); p=p+4; if (p>=23) { p=8; getch(); clrscr(); gotoxy(20,3); printf("REPORT OF TOTAL CONSIGNMENT(DELIVERED)"); gotoxy(1,5); printf("SRNO"); gotoxy(6,5); printf("SEN_NAME"); gotoxy(5,6); printf("ADDRESS & CITY"); gotoxy(28,5); printf("PHNO"); gotoxy(35,5); printf("TYPE");

gotoxy(40,5); printf("DATE"); gotoxy(50,5); printf("ADD_NAME"); gotoxy(49,6); printf("ADDRESS & CITY"); gotoxy(72,5); printf("PHNO"); } } fclose(ds); getch(); return(0); }

#include<stdio.h> #include<conio.h> main() { FILE *temp; int sn=100; temp=fopen("courcode","wb"); fwrite(&sn,sizeof(sn),1,temp); fclose(temp); }

OUTPUTS AND REPORTS


=========MAIN MENU========= 1.:-CONSIGNMENT MENU 2.:-REPORT MENU 3.:-CONSIGNMENT DELIVERY 4.:-QUIT MENU SELECT ANY ONE: ENTER YOUR CHOICE:

CONSIGNMENT MENU

1.:ADDITION OF CONSIGNMENT 2.:MODIFICATION OF CONSIGNMENT 3.:DELETION OF CONSIGNMENT 4.:EXIT TO MAIN MENU

SELECT ANY ONE:

CONSIGNMENT ADDITION

CON. NO. IS:104 ENTER SENDER'S NAME/DEPT.:sanjay ENTER ADDRESS:234,mt ENTER CITY:ynr ENTER PHONE NO.:20280 ENTER CONSIGNMENT TYPE:[L/P]:l DATE IS:[DD MM YYYY]:27 2 2007 ENTER AMOUNT:30 ENTER WEIGHT:15 TIME IS:[HH:MM:SS]:10:4:28

ENTER ADDRESSEE'S NAME:sumit ENTER CITY:jagadhri

ENTER ADDRESS:254,cvt ENTER PHONE NO.:20345

Our Liability For Any Loss Or Damage To The Shipment Is Only Rs. 100/- Only INFORMATION CORRECT:[Y/N]:y

CONSIGNMENT DELETION ENTER CONSIGNMENT NUMBER:104 SENDER'S NAME/DEPT.:sanjay ADDRESS:234,mt CITY:ynr PHONE NO.:20280 CONSIGNMENT TYPE:[L/P]:l DATE IS:[DD MM YYYY]:27 2 2007 AMOUNT:30.000000 WEIGHT:15.000000 TIME IS:[HH:MM:SS]:10:4:28 ADDRESSEE'S NAME:sumit CITY:jagadhri ADDRESS:254,cvt PHONE NO.:20345

DO YOU WANT TO DELETE THIS RECORD:y

DELETE MORE ENTRY:n

REPORT MENU

1.:SINGLE CONSIGNMENT ENQUIRY 2.:TOTAL CONSIGNMENT REPORT 3.:DELIVERED CONSIGNMENT REPORT 4.:NON-DELIVERED CONSIGNMENT METHOD 5.:EXIT TO MAIN MENU

SELECT ANY ONE:

ENQUIRY SINGLE CONSIGNMENT ENTER CONSIGNMENT NUMBER:103 SENDER'S NAME/DEPT.:amit ADDRESS:24,mt CITY:ynr PHONE NO.:222022 CONSIGNMENT TYPE:[L/P]:l DATE IS:[DD MM YYYY]:26 1 2007 AMOUNT:20.000000 WEIGHT:2.000000 TIME IS:[HH:MM:SS]:11:19:18 ADDRESSEE'S NAME:sachin CITY:ynr ADDRESS:256,sugarmill PHONE NO.:229067

ENQUIRY MORE ENTRY:n

REPORT OF TOTAL CONSIGNMENT SRNO SEN_NAME PHNO TYPE DATE ADD_NAME ADDRESS & CITY ADDRESS & CITY 101 amit 165,arogya ynr 102 s.c.gupta 123,mt ynr 20280 l 27-1-2007 vivek 267,huda jagadhri 27-1-2007 m.l.bansal 167-t,ashoknagar ludhiyana PHNO

32516

20675

24648

DELIVERY MENU ENTER CONSIGNMENT NUMBER:101 SENDER'S NAME/DEPT.:amit ADDRESS:165,arogya CITY:ynr PHONE NO.:20280 CONSIGNMENT TYPE:[L/P]:l DATE IS:[DD MM YYYY]:27 1 2007 AMOUNT:25.000000 WEIGHT:24.000000 TIME IS:[HH:MM:SS]:10:15:42 ADDRESSEE'S NAME:vivek CITY:jagadhri ADDRESS:267,huda PHONE NO.:32516

CONSIGNMENT DELIVERED :[INFORMATION CORRECT:y

DELIVER MORE ENTRY:n

REPORT OF TOTAL CONSIGNMENT(DELIVERED) SRNO SEN_NAME PHNO TYPE DATE ADD_NAME ADDRESS & CITY ADDRESS & CITY 101 amit 165,arogya ynr 20280 l 27-1-2007 vivek 267,huda jagadhri PHNO

32516

REPORT OF TOTAL CONSIGNMENT(NON-DELIVERED) SRNO SEN_NAME ADDRESS & CITY 102 s.c.gupta 123,mt ynr PHNO TYPE DATE ADD_NAME ADDRESS & CITY PHNO

20675

l 27-1-2007 m.l.bansal 167-t,ashoknagar ludhiyana

24648

You might also like