Вы находитесь на странице: 1из 19

TERM PAPER OF COMPUTING-1

(TOPIC:GAS AGENCY SYSTEM)


SUBMITTED TO: Mr.VIVEK SUBMITTED BY: LAKSHAY VERMA ROLL NO-A10(997) BCA(HONS.)MCA Contact-7696233676

ACKNOWLEDGEMENT
This is a humble effort to express our sincere gratitude towards those who have guided and helped us to complete this project. A project reported is major milestone during the study period of a student. We could have faced many problems but our teachers kind response to our needs and requirement, their patient approach and their positive criticism helped us in making our project. Very warm thanks to our project-incharge Mr.VIVEK with her support and constant encouragement and LPU LIBRARY it was not very easy without whose support to finish our project . With the motivation of our parent it was very easy to finish our project successfully and satisfactorily in short span of time.

CONTENTS
1.INTRODUCTION 2.PROPOSED SYSTEM DESCRIPTION 3.REQUIRMENTS 4.ANALYSIS 5.SOURCE CODE 6.TESTING 7.FUTURE SCOPE PROJECT

INTRODUCTION
GAS AGENCY SYSTEM IS A PROJECT IN WHICH ALL INFORMATION OFCYLINDER LIKE CYLINDER COMPANY,NUMBER,REPLACED CYLINDER,DAMAGAD CYLINDER,CHARGES OF CYLINDER,TOTAL LOSS ETC IS GIVEN.IN THIS WE CAN EASILY FETCH THE DATA OF AGENCY TO MAINTAIN AGANCY INFORMATION WE USE .

DESCRIPTION
GAS AGENCY SYSTEM IS USED IN MANY WAYS.DUE TO THIS SYSTEM CHANGES CAN BE MADE EASILY.THIS SYSTEMIS TIME SAVING.MAIN AIM OF THIS SYSTEM IS TO REMOVE ALL THE DIFFICULTIES THAT ARE GACED IN EARLIER SYSTEM.DATA OF ENTIRE AGENCY IS STORED IN THIS SYSTEM LIKE CYLINDER COMPANY,NUMBER,REPLACED,DAMAGED ETC.TOTAL CHARGES.SOMETIMES WEWANT TO KNOW THE DATA OF A PARTICULAR CYLINDER THEN WE CAN EASILY SEARCH IT WITH THIS SYSTEM.ANY CHANGE CAN BE DONE EASILY WITH THIS SYSTEM ALL WORK IS DONE BY COMPUTER NOT BY HANDS SO IT CAN BE USED EASILY.

REQUIRMENTS
PROCESSOR-INTEL DUEL CORE SPEED OF PROCESSOR-2 GB MEMORY OF RAM-1 GB MEMORY SPACE-160 GB

ANALYSIS
EARLIER ALL WORK IS DONE MANUALLY.DUE TO WHICH SOMETIMESFORGET TO UPLOAD SOMETHING CHANGE WHICH IS INPORTANT THEREFORE THIS WORK IS MORE TEDIOUS AND TIME CONSUMING. TO OVERCOME THIS PROBLEM,THIS GAS AGENCY SYSTEMIS MADE.DUE TO THIS ALL PROBLEMS FACED ARE REMOVED.SEARCHING ABOUT SOMETHING IS ALSO VERY SIMPLE.THEREFORE IN END CONCLUSION COMES OUT THAT THIS SYSTEM IS MUCH BETTER AND ADVANCE THAN EARLIER ONES.

SOURCE CODING
*********************************************************************** */ /* _______________________________________________________________________ */ /* PROJECT GAS AGENCY SYSTEM */ /* ----------------------------------------------------------------------- */ /* *********************************************************************** */ #include <stdio.h> #include <conio.h> #include <iostream.h> #include <process.h> #include <graphics.h> void entry(); void display(); void search(); void del(); void edit(); void help(); void design(); void box(double,double); void bbox(); struct badar { char comp name[20]; int los; int,charg,total; }; struct badar temp; FILE *ptr; /*******************************MAIN MENU*****************************/ void main() { char ch;

clrscr(); design(); clrscr(); gotoxy(25,4); textcolor(YELLOW+BLINK); cprintf("COMPUTERISED GAS AGENCY SYSTEM"); bbox(); int l=23; int l1=3; box(l,l1); gotoxy(27,6); textcolor(GREEN); cprintf("1-New cylinder entry."); gotoxy(27,8); textcolor(GREEN); cprintf("2-Display cylinder details."); gotoxy(27,10); textcolor(GREEN); cprintf("3-Search for cylinder record."); gotoxy(27,12); textcolor(GREEN); cprintf("4-Delete specfic cylinder record."); gotoxy(27,14); textcolor(GREEN); cprintf("5-Edit Specific Record."); gotoxy(27,16); textcolor(GREEN); cprintf("6-Help for users."); gotoxy(27,18); textcolor(GREEN); cprintf("7-Exit"); gotoxy(28,20); cprintf("Select an option:"); ch=getche(); switch (ch) { case '1': entry(); break; case '2': display(); break;

case '3': search(); break; case '4': del(); break; case '5': edit(); break; case '6': help(); break; case '7': exit(0); break; default: gotoxy(40,23); printf("Wrong Entry"); getch(); main(); } } /**********************************NEW CYLINDER RECORD ENTRY********************/ void entry() {char a='y'; clrscr(); ptr=fopen("badar.dat","ab+"); while (a=='y') { clrscr(); gotoxy(28,2); printf("NEW CYLINDER ENTRY"); gotoxy(6,3); printf("----------------------------------------------------------------------"); gotoxy(2,4); printf("1) gas agancy name="); scanf("%s",temp.gas_agency); //gets(temp.gas_agency); flushall(); gotoxy(2,6); printf("2) cylinder company="); scanf("%d",&temp.company);

flushall(); gotoxy(2,8); printf("3) cylinder number="); scanf("%d",&temp.cylinder); flushall(); gotoxy(2,10); printf("4) cylinder nymber="); scanf("%s",temp.number); flushall(); gotoxy(2,12); printf("5) Replaced cylinder="); scanf("%s",temp.replaced); flushall(); gotoxy(2,14); printf("6) Enter damaged cylinder="); scanf("%d",&temp.dam); flushall(); gotoxy(2,16); printf("7) Enter charge="); scanf("%d",&temp.charg); temp.total=temp.dam*temp.charg; flushall(); gotoxy(2,18); printf("8) Total loss %d \n",temp.total); fwrite(&temp,sizeof(temp),1,ptr); gotoxy(29,22); printf("You want to enter more record (y/n)?"); a=getche(); continue; } fclose(ptr); main(); } /***************************RECORD DISPLAY*****************************/ void display() { double j; double r=10; clrscr();

ptr=fopen("badar.dat","rb"); gotoxy(30,3); printf("NEW CYLINDER ENTRY"); gotoxy(28,4); printf("\n"); for(j=0;j<80;j++) printf("-"); gotoxy(6,6); printf("Company"); gotoxy(6,7); printf("Name"); gotoxy(20,6); printf("Cylinder"); gotoxy(20,7); printf("company"); gotoxy(30,6); printf (cylinderNo."); gotoxy(44,6); printf ("replaced"); gotoxy(44,7); printf ("cylinder"); gotoxy(58,6); printf ("damaged"); gotoxy(58,7); printf("cylinder"); gotoxy(70,6); printf("Total"); gotoxy(70,7); printf("charges"); printf("\n"); for(j=0;j<80;j++) printf("-"); while (fread(&temp,sizeof(temp),1,ptr)==1) { gotoxy(6,r); printf("%s",temp.gas agency name); flushall(); gotoxy(20,r); printf("%d",temp.company); flushall();

gotoxy(30,r); printf("%d",temp.cylinder); flushall(); gotoxy(44,r); printf("%s",temp.replaced); flushall(); gotoxy(58,r); printf("%s",temp.damaged); flushall(); gotoxy(70,r); printf("%d",temp.charges); flushall(); r++; } fclose(ptr); getch(); main(); }

/******************Search Specified Record********************/ void search() { char another='y'; ptr=fopen("badar.dat","rb");while (another=='y') { double check=0; int x; clrscr(); gotoxy(26,8); printf("Enter cylinder No to View: "); scanf("%d",&x); gotoxy(26,8); rewind(ptr); while(fread(&temp,sizeof(temp),1,ptr)==1) { if(temp.cylinder==x) { gotoxy(26,10); printf ("agency name is: gotoxy(26,12);

%s",temp.agency name);

printf ("Cylinder company is: %d",temp.company); gotoxy(26,14); printf("cylinder number is: %s",temp.cylinder); gotoxy(26,16); printf("Replaced cylinder is: %s",temp.replaced); gotoxy(26,18); printf("Total loss: %d",temp.total); check=1; break; } } if (check==0) { gotoxy(28,18); printf("This Cylinder of this company . Does Not Exist"); } gotoxy(28,20); printf("View More Records Y/N....? "); another=getche(); continue; } fclose(ptr); main(); } /***********************DELETION***************************************/ void del() { int r,found; char choice; FILE *ptr, *tptr; textbackground(BLUE); textcolor(WHITE); ptr=fopen("badar.dat","rb"); tptr=fopen("badar.tmp","wb"); clrscr(); gotoxy(24,4); printf("Enter cylinderNumber To Delete : "); scanf("%d",&r); found=0; while(fread(&temp,sizeof(temp),1,ptr)==1)

{ if(temp.engine==r) { found=1; clrscr(); gotoxy(24,6); printf("\n gas agency name %s.",temp.gas agancy); gotoxy(24,8); printf("\n cylinder company :%d \n",temp.company); gotoxy(24,10); printf("\n cylinder number :Rs.%s \n",temp.cylinder); gotoxy(24,12); printf("\n Replaced cylinder:%s \n",temp.replaced); // temp.total=temp.price*temp.quantity;*/ // printf("\n Total:Rs.%d \n",temp.total); printf("\n\n Is this the record to be deleted ?(y/n)"); choice = getche(); if (choice=='n'||choice=='N') fwrite(&temp,sizeof(temp),1,tptr); } else fwrite(&temp,sizeof(temp),1,tptr); } if (!found) { printf("No Such `cylinder Number' Exists In The File...\a"); getch(); } fclose(ptr); fclose(tptr); if (found) { remove("badar.dat"); rename("badar.tmp","badar.dat"); } main(); } /*****************************HELP TOPICS*********************************/ void help() {

clrscr(); printf("\t\t\t\tHELP FOR USERS"); gotoxy(2,3); printf("This program is very simple and self explanatory."); printf("\n"); printf("\n1) First run the program by pressing Ctrl+F9."); printf("\n"); printf("\n2) A page will open which contains all the actions which can be performed\n by the program."); printf("\n"); printf("\n3) If you want to record the data of new survey cylinder,press key 1."); printf("\n"); printf("\n4) In order to view all the entered records,press key 2."); printf("\n"); printf("\n5) If you want to know the informations of a particular cylinder,press key 3\n and enter cylinder number."); printf("\n"); printf("\n6) To get rid of unnecessary records,you may want to delete it,so press key 4\n and enter cylinder number for that purpose."); printf("\n"); printf("\n7) If you need a hard copy of enterd records or any page contained in the\n program,press key 6."); printf("\n"); printf("\n8) When you finish your work,press key 7 to exit."); getch(); main(); } /************************Edit Record***************************/ void edit() { FILE *tptr; int found=0; int id; char choice; int tot; clrscr(); bbox(); ptr=fopen("badar.dat","rb"); tptr=fopen("badar.tmp","wb"); gotoxy(30,2); printf("NEW CYLINDER ENTRY"); gotoxy(28,3);

printf("-----------------------"); gotoxy(26,6); printf("Enter cylinderNo to Edit: "); scanf("%d",&id); gotoxy(26,8); while(fread(&temp,sizeof(temp),1,ptr)==1) { if(temp.engine==id) { found=1; printf("gas agency name [%s] ",temp.gas_agency); scanf("%s",temp.gas agency); gotoxy(26,10); printf("Cylinder company [%d] ",temp.company); scanf("%d",&temp.company); gotoxy(26,12); printf(cylinder number[%s] ",temp.cylinder); scanf("%s",temp.cylinder); gotoxy(26,14); printf("Replaced cylinder [%s] ",temp.replaced); scanf("%s",temp.replaced); gotoxy(26,16); printf("Enter damaged parts [%d] ",temp.dam); scanf("%d",&temp.dam); gotoxy(26,18); printf("Enter charges [%d] ",temp.charg); scanf("%d",&temp.charg); temp.total=temp.dam*temp.charg; gotoxy(26,20); printf("Total loss %d \n",temp.total); gotoxy(26,22); printf ("Want to Save it (y/n)?"); choice=getche(); if (choice=='n' || choice=='N') fwrite(&temp,sizeof(temp),1,tptr); else fwrite(&temp,sizeof(temp),1,tptr); } }

if (!found) { printf("No Such `cylinder Number' Exists In The File...\a"); getch(); } fclose(ptr); fclose(tptr); if (found) { remove("badar.dat"); rename("badar.tmp","badar.dat"); } main(); } /***************************Designing*****************************/ void design() { double l=17; double l1=4; box(l,l1); bbox(); gotoxy(25,8); textcolor(GREEN); cprintf("Computerized gas agency System"); gotoxy(37,10); textcolor(GREEN); cprintf("for"); gotoxy(32,12); textcolor(GREEN); cprintf("Agency & Co."); gotoxy(30,13); textcolor(GREEN); cprintf("agency Surveyor"); gotoxy(33,14); textcolor(GREEN); cprintf("Loss Accessor"); gotoxy(36,15); textcolor(GREEN); cprintf("Patiala"); gotoxy(50,23); cout<<"Prepared By..."; gotoxy(59,25); textcolor(YELLOW + BLINK); cprintf(" ANKIT RAGHUVANSHI");

gotoxy(27,5); textcolor(WHITE); cprintf(" I N T R O D U C T I O N "); getch(); // textcolor(15); } void box(double l,double l1) { int c,r; gotoxy(23,l1); textcolor(RED); cprintf(""); for(c=24;c<=55;c++) { gotoxy(c,l1);//l1=2 textcolor(YELLOW); cprintf(""); gotoxy(c,l1+2);//l1+2 textcolor(YELLOW); cprintf(""); gotoxy(c,l); textcolor(YELLOW); cprintf(""); } gotoxy(56,l1);//l1 textcolor(RED); cprintf(""); gotoxy(23,l1+1);//l1+1 textcolor(YELLOW); cprintf(""); gotoxy(56,l1+1);//l1+1 textcolor(YELLOW); cprintf(""); gotoxy(23,l1+2);//l1+2 textcolor(YELLOW); cprintf(""); gotoxy(56,l1+2);//l1+2 textcolor(YELLOW); cprintf(""); for(r=l1+3;r<=l;r++)//r=l1+3 { gotoxy(23,r); textcolor(YELLOW); cprintf("");

gotoxy(56,r); textcolor(YELLOW); cprintf(""); } gotoxy(23,l); textcolor(RED); cprintf(""); gotoxy(56,l); textcolor(RED); cprintf(""); } void bbox() { int c,r; for(c=1;c<=79;c++) { gotoxy(c,1); textcolor(RED); cprintf(""); gotoxy(c,25); textcolor(RED); cprintf(""); } for(r=1;r<=24;r++) { gotoxy(1,r); textcolor(RED); cprintf(""); gotoxy(79,r); textcolor(RED); cprintf(""); } }

TESTING
GAS AGENCY SYSTEM GAS AGENCY NAME: CYLINDER COMPANY: CYLINDER NUMBER: REPLACED CYLINDER DAMAGED CYLINDER: TATAL CHARGES:

Вам также может понравиться