Sie sind auf Seite 1von 24

LOVELY PROFESSIONAL UNIVERSITY

TERM PAPER OF OBJECT ORIENTED PROGRAMMING SYSTEM CSE:-202 TOPIC :- PETROL PUMP MANAGEMENT SYSTEM

SUBMITTED TO:Mr.Shaishav Aggarwal

SUBMITTED BY:Divya Mahajan Section:-RE1801 Roll No:-A10 Course:-B-Tech(CSE) Redg No:-10812533

ACKNOWLEDGEMENT

We are extremely grateful and remain indebted to our guide Mr.Shaishav Aggarwal for being a source of insipiration and for his constant support in the design,implementation and evaluation of the project.We are thankful to them for their constant constructive criticism and invaluable suggestions,which benefited us a lot while developing the project onPetrol Pump Management.He has been a constant source of insipiration and motivation for hard work.He has been very co-operative throughout this project work.Through this column,it would be our atmost pleasure to express our warm thanks to him for their encouragment,co-operation and consent without which we mightnt be able to accomplish this project. We also express our gratitude to Mr.Shaishav Aggarwal for providing us the infrastructure to carry out the project and to all staff members who were directly and indirectly instrument in enabling us to stay committed for the project.

THANKING YOU Divya Mahajan

CONTENTS:1.Preface 2.Process description 3.Source code 4.Features of petrol pump management 5.Benefits of petrol pump management 6.Refrences 7.Bibliography

PREFACE
This project ofPetrol Pump Managementof gives us the complete information about the petrol pump.We can enter the record of petrol and diesel which is available in petrol pump,In this project we can maintain the rate of diesel and all kind of petrol. Throughout the project the focus has been on presenting information and comments in an easy and intelligible manner.The project is very useful for those who want to know about petrol pump management system. In the last,we gratefully acknowledge and express our gratitude to all staff members of PRS computer and friends who supported us in preparing this project.

PROCESS DESCRIPTION

ThePETROL PUMP MANAGEMENT SYSTEMis designed and developed for a rates and types and record of petrol in te petrol pump along with the customer details.The petrol received in the petrol pump are entered in record list and the next customer entered in the record list.When the customer wants to get the desired petrol or diesel the on the availability basis to the customer.The customer has to pay the price of petrol or diesel ,if any on the basis of no.of rates of the petrol or diesel in the petrol pump.

SOURCE CODE
#include<iostream.h> #include <fstream.h> #include <string.h> #include <stdlib.h> #include <stdio.h> #include <ctype.h> #include <conio.h> #include <dos.h> #include <iomanip.h> int i,j,li,lp,rec; void help(); char ch,choice; class DRAW { public : void LINE_HOR(int, int, int, char) ; void LINE_VER(int, int, int, char) ; void BOX(int,int,int,int,char) ; }; class CHARGE { private : int Category ; float oil, petrol, diesal, extra, other ; void DISPLAY(int) ; void MODIFY_RECORD(int, float, float, float, float, float) ; public : void ADDITION(void) ; void MODIFICATION(void) ; void FEE_SLIP(void) ; void LIST(void) ; void HELP(void); }fee ; //********************************************************** // MAIN MENU FUNCTION //********************************************************** void mainmenu() { clrscr(); textcolor(WHITE);

for(li=30;li<=30;li++) { textcolor(WHITE); gotoxy(li,13); delay(30); printf("*"); } for(li=50;li>=30;li--) { textcolor(WHITE); gotoxy(li,29-1); delay(30); printf("*"); } for(lp=15;lp<29;lp++) { gotoxy(31,lp-1); delay(100); printf("|"); } for(lp=28;lp>=15;lp--) { gotoxy(50,lp-1); delay(100); printf("|"); } gotoxy(15,10); textcolor(LIGHTGRAY); cprintf("Press the corresponding Keys for the desired action"); gotoxy(35,15); textcolor(BROWN); cprintf("C: CHARGE SLIP"); gotoxy(35,17); textcolor(LIGHTMAGENTA); cprintf("M: MODIFY"); gotoxy(35,19); textcolor(LIGHTBLUE); cprintf("L: LIST"); gotoxy(35,21); textcolor(LIGHTRED); cprintf("H: HELP"); gotoxy(35,23); textcolor(GREEN); cprintf("Q: QUIT"); choice=getch(); ch=toupper(choice);

switch(ch) { case'C':fee.FEE_SLIP(); break; case'M':fee.MODIFICATION(); break; case'L':fee.LIST(); break; case'H':fee.HELP(); break; case'Q':exit(0); break; default:clrscr(); gotoxy(33,40); cout<<"\n\n\n\tIllegal Choice Press any key to return to Main Menu"; getch(); mainmenu(); } //Main Menu Function End

//********************************************************** // FUNCTION TO DRAW HORIZONTAL LINE //********************************************************** void DRAW :: LINE_HOR(int column1, int column2, int row, char c) { for ( column1; column1<=column2; column1++ ) { gotoxy(column1,row) ; cout <<c ; } } //********************************************************** // FUNCTION TO DRAW VERTICAL LINE //********************************************************** void DRAW :: LINE_VER(int row1, int row2, int column, char c) { for ( row1; row1<=row2; row1++ ) { gotoxy(column,row1) ; cout <<c ; }

} //********************************************************** // FUNCTION TO DRAW BOX LINE //********************************************************** void DRAW :: BOX(int column1, int row1, int column2, int row2, char c) { char ch=218 ; char c1, c2, c3, c4 ; char l1=196, l2=179 ; if (c == ch) { c1=218 ; c2=191 ; c3=192 ; c4=217 ; l1 = 196 ; l2 = 179 ; } else { c1=c ; c2=c ; c3=c ; c4=c ; l1 = c ; l2 = c ; } gotoxy(column1,row1) ; cout <<c1 ; gotoxy(column2,row1) ; cout <<c2 ; gotoxy(column1,row2) ; cout <<c3 ; gotoxy(column2,row2) ; cout <<c4 ; column1++ ; column2-- ; LINE_HOR(column1,column2,row1,l1) ; LINE_HOR(column1,column2,row2,l1) ; column1-- ; column2++ ; row1++ ; row2-- ;

LINE_VER(row1,row2,column1,l2) ; LINE_VER(row1,row2,column2,l2) ; } //********************************************************** // FUNCTION TO ADD FEE STRUCTURE IN CHARGE FILE //********************************************************** void CHARGE :: ADDITION(void) { fstream file ; file.open("FEE.DAT", ios::in) ; if (!file.fail()) return ; file.close() ; file.open("FEE.DAT", ios::app) ; for (int i=1; i<=12; i++) { Category = i ; oil = 0.0 ; petrol = 0.0 ; diesal = 0.0 ; extra= 0.0 ; other= 0.0 ; file.write((char *) this, sizeof(CHARGE)) ; } file.close() ; MODIFY_RECORD(12,450,50,60,60,50) ; MODIFY_RECORD(11,450,50,60,60,50) ; MODIFY_RECORD(10,350,50,30,60,50) ; MODIFY_RECORD(9,350,50,20,60,50) ; MODIFY_RECORD(8,300,50,20,40,50) ; MODIFY_RECORD(7,300,50,20,40,50) ; MODIFY_RECORD(6,300,50,20,40,50) ; MODIFY_RECORD(5,250,50,0,40,40) ; MODIFY_RECORD(4,250,50,0,40,40) ; MODIFY_RECORD(3,250,50,0,40,40) ; MODIFY_RECORD(2,250,50,0,40,40) ; MODIFY_RECORD(1,250,50,0,40,40) ; } //********************************************************** // FUNCTION TO DISPLAY TOTAL CHARGE AS LIST //**********************************************************

void CHARGE :: LIST() { clrscr() ; DRAW d ; textcolor(MAGENTA); d.BOX(1,2,80,24,218) ; gotoxy(27,3) ; cout <<"TOTAL CHARGES FOR THE CATEGORY" ; d.LINE_HOR(2,79,4,196) ; gotoxy(5,5) ; cout <<"CATEGORY TOTAL CHARGES" ; d.LINE_HOR(2,79,6,196) ; d.LINE_HOR(2,79,22,196) ; float total ; int row=8 ; fstream file ; file.open("FEE.DAT", ios::in) ; while (file.read((char *) this, sizeof(CHARGE))) { total = oil + petrol + diesal + extra + other ; gotoxy(6,row) ; cout <<Category ; gotoxy(23,row) ; cout <<total ; row++ ; } file.close() ; gotoxy(5,23) ; cout <<"Press any key to continue............." ; getch() ; mainmenu(); } //********************************************************** // FUNCTION TO DISPLAY THE RECORD FOR THE GIVEN CLASS //********************************************************** void CHARGE :: DISPLAY(int tclass) { fstream file ; file.open("FEE.DAT", ios::in) ; while (file.read((char *) this, sizeof(CHARGE))) { if (Category == tclass)

{ gotoxy(5,5) ; cout <<"CATEGORY : " <<Category ; gotoxy(5,7) ; cout <<"~~~~~~~~~~~~" ; gotoxy(5,8) ; cout <<"OIL CHARGE : " <<oil ; gotoxy(5,9) ; cout <<"PETROL : " <<petrol ; gotoxy(5,10) ; cout <<"DIESAL : " <<diesal ; gotoxy(5,11) ; cout <<"EXTRA PREMIUM: " <<extra ; gotoxy(5,12) ; cout <<"OTHER CHARGES : " <<other ; break ; } } file.close() ; } //********************************************************** // FUNCTION TO MODIFY THE CHARGE RECORD FOR THE GIVEN DATA //********************************************************** void CHARGE :: MODIFY_RECORD(int tclass, float ttution, float tac, float tscience, float tcomputer, float tactivity) { fstream file ; file.open("FEE.DAT", ios::in) ; fstream temp ; temp.open("temp.dat", ios::out) ; file.seekg(0,ios::beg) ; while (!file.eof()) { file.read((char *) this, sizeof(CHARGE)) ; if (file.eof()) break ; if (tclass == Category) { Category = tclass ; oil = ttution ; petrol = tac ; diesal = tscience ; extra= tcomputer ;

other= tactivity ; temp.write((char *) this, sizeof(CHARGE)) ; } else temp.write((char *) this, sizeof(CHARGE)) ; } file.close() ; temp.close() ; file.open("FEE.DAT", ios::out) ; temp.open("temp.dat", ios::in) ; temp.seekg(0,ios::beg) ; while (!temp.eof()) { temp.read((char *) this, sizeof(CHARGE)) ; if (temp.eof()) break ; file.write((char *) this, sizeof(CHARGE)) ; } file.close() ; temp.close() ; } //********************************************************** // FUNCTION TO GIVE DATA TO MODIFY THE CHARGE RECORD //********************************************************** void CHARGE :: MODIFICATION(void) { clrscr() ; textcolor(WHITE); char ch, t1[10] ; int valid=0, t=0, tclass=0 ; float t2=0 ; do { valid = 1 ; gotoxy(5,25) ; clreol() ; cout <<"Press <ENTER> for EXIT" ; gotoxy(5,5) ; clreol() ; cout <<"Enter Category for the Modification of the charge Structure : " ; gets(t1) ; t = atoi(t1) ; tclass = t ; if (strlen(t1) == 0) return ;

if (tclass < 1 || tclass > 12) { valid = 0 ; gotoxy(5,25) ; clreol() ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; clrscr() ; gotoxy(71,1) ; cout <<"<0>=Exit" ; DISPLAY(tclass) ; gotoxy(5,25) ; clreol() ; do { gotoxy(5,15) ; clreol() ; cout <<"Do you want to modify the Charge structure (y/n) : " ; ch = getche() ; if (ch == '0') return ; ch = toupper(ch) ; } while (ch != 'N' && ch != 'Y') ; if (ch == 'N') mainmenu(); float ttution=0.0, tac=0.0, tscience=0.0, tcomputer=0.0, tactivity=0.0 ; gotoxy(5,13) ; clreol() ; gotoxy(5,17) ; cout <<"OIL : " ; gotoxy(5,18) ; cout <<"PETROL : " ; gotoxy(5,19) ; cout <<"DIESLA : " ; gotoxy(5,20) ; cout <<"EXTRA PREMIMUM : " ; gotoxy(5,21) ; cout <<"OTHER CHARGES : " ; int modified = 5 ; fstream file ; file.open("FEE.DAT", ios::in) ; while (file.read((char *) this, sizeof(CHARGE))) if (Category == tclass) break ; file.close() ; do {

valid = 1 ; gotoxy(5,27) ; clreol() ; cout <<"Enter Oil Charges or Press <ENTER> for no change" ; gotoxy(19,17) ; clreol() ; gets(t1) ; t2 = atof(t1) ; ttution = t2 ; if (t1[0] == '0') return; if (strlen(t1) == 0) break ; if (ttution > 1000) { valid = 0 ; gotoxy(5,27) ; clreol() ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; if (strlen(t1) == 0) { modified-- ; ttution = oil ; gotoxy(20,17) ; cout <<ttution ; } do { valid = 1 ; gotoxy(5,27) ; clreol() ; cout <<"Enter Petrol Charges or Press <ENTER> for no change" ; gotoxy(26,18) ; clreol() ; gets(t1) ; t2 = atof(t1) ; tac = t2 ; if (t1[0] == '0') return ; if (strlen(t1) == 0) break ; if (tac > 1000) { valid = 0 ; gotoxy(5,27) ; clreol() ; cout <<"7Enter correctly" ; getch() ; }

} while (!valid) ; if (strlen(t1) == 0) { modified-- ; tac = petrol ; gotoxy(26,18) ; cout <<tac ; } do { valid = 1 ; gotoxy(5,27) ; clreol() ; cout <<"Enter Diesal Charges or Press <ENTER> for no change" ; gotoxy(19,19) ; clreol() ; gets(t1) ; t2 = atof(t1) ; tscience = t2 ; if (t1[0] == '0') return ; if (strlen(t1) == 0) break ; if (tscience > 1000) { valid = 0 ; gotoxy(5,27) ; clreol() ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; if (strlen(t1) == 0) { modified-- ; tscience = diesal ; gotoxy(19,19) ; cout <<tscience ; } do { valid = 1 ; gotoxy(5,27) ; clreol() ; cout <<"Enter Extra Premium Charge or Press <ENTER> for no change" ; gotoxy(19,20) ; clreol() ; gets(t1) ; t2 = atof(t1) ; tcomputer = t2 ; if (t1[0] == '0')

return ; if (strlen(t1) == 0) break ; if (tcomputer > 1000) { valid = 0 ; gotoxy(5,27) ; clreol() ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; if (strlen(t1) == 0) { modified-- ; tcomputer = extra ; gotoxy(19,20) ; cout <<tcomputer ; } do { valid = 1 ; gotoxy(5,27) ; clreol() ; cout <<"Enter Other Charges or Press <ENTER> for no change" ; gotoxy(19,21) ; clreol() ; gets(t1) ; t2 = atof(t1) ; tactivity = t2 ; if (t1[0] == '0') return; if (strlen(t1) == 0) break; if (tactivity > 1000) { valid = 0 ; gotoxy(5,27) ; clreol() ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; if (strlen(t1) == 0) { modified-- ; tactivity = other ; gotoxy(19,21) ; cout <<tactivity ; }

if (!modified) mainmenu(); gotoxy(5,27) ; clreol() ; do { gotoxy(5,25) ; clreol() ; cout <<"Do you want to save (y/n) : " ; ch = getche() ; if (ch == '0') return ; ch = toupper(ch) ; } while (ch != 'N' && ch != 'Y') ; if (ch == 'N') return ; MODIFY_RECORD(tclass,ttution,tac,tscience,tcomputer,tactivity); gotoxy(5,27) ; cout <<"7Record Modified" ; gotoxy(5,29) ; cout <<"Press any key to continue..........." ; getch() ; mainmenu(); } //********************************************************** // FUNCTION TO DISPLAY THE CHARGE SLIP FOR THE CATEGORY //********************************************************** void CHARGE :: FEE_SLIP(void) { clrscr() ; textcolor(RED); char ch, t1[10] ; int valid=0, t=0, tclass=0 ; do { valid = 1 ; gotoxy(5,25) ; clreol() ; cout <<"Press <ENTER> for EXIT" ; gotoxy(5,5) ; clreol() ; cout <<"Enter Category to see the price structure : " ; gets(t1) ; t = atoi(t1) ; tclass = t ; if (strlen(t1) == 0) return ;

if (tclass < 1 || tclass > 4) { valid = 0 ; gotoxy(5,25) ; clreol() ; cout <<"7Enter correctly" ; getch() ; } } while (!valid) ; char name[26] ; do { gotoxy(5,25) ; clreol() ; cout <<"ENTER NAME OF THE COSTUMER" ; valid = 1 ; gotoxy(5,7) ; clreol() ; cout <<"Name : " ; gets(name) ; if (strlen(name) < 1 || strlen(name) > 25) { valid = 0 ; gotoxy(5,25) ; clreol() ; cout <<"NAME SHOULD NOT BE GREATER THAN 25" ; getch() ; } } while (!valid) ; clrscr() ; DRAW d ; d.BOX(20,2,61,24,987) ; gotoxy(24,3) ; cout <<" DIVYA REALESTATE "; int d1, m1, y1 ; struct date dt; getdate(&dt); d1 = dt.da_day ; m1 = dt.da_mon ; y1 = dt.da_year ; gotoxy(45,4) ; cout <<"Date: " <<d1 <<"/" <<m1 <<"/" <<y1 ; d.LINE_HOR(21,60,5,196) ; gotoxy(22,6) ; cout <<"NAME : " <<name ; gotoxy(22,7) ; cout <<"Type : " <<tclass ; d.LINE_HOR(21,60,8,196) ; gotoxy(21,9) ; cout <<" DETAILS PRICE" ;

// }

d.LINE_HOR(21,60,10,196) ; d.LINE_HOR(21,60,22,196) ; d.LINE_HOR(46,60,20,196) ; gotoxy(25,21) ; cout <<"TOTAL" ; gotoxy(54,23) ; cout <<"CASHIER" ; fstream file ; file.open("FEE.DAT", ios::in) ; while (file.read((char *) this, sizeof(CHARGE))) if (Category == tclass) break ; file.close() ; float total=0.0 ; gotoxy(23,12) ; cout <<" SINGLE BEDROOM " <<setprecision(2) <<oil ; total = total+oil ; gotoxy(23,13) ; cout <<" ONE BATHROOM " <<setprecision(2) <<petrol ; total = total+petrol ; gotoxy(23,14) ; cout <<" LOBBY " <<setprecision(2) <<diesal ; total = total+diesal ; gotoxy(23,15) ; cout <<" KITCHEN " <<setprecision(2) <<extra ; total = total+extra ; gotoxy(23,16) ; cout <<" OTHER " <<setprecision(2) <<other ; total = total+other ; d.LINE_VER(9,21,46,179) ; char tt[15] ; sprintf(tt,"%f",total) ; gotoxy(49,21) ; cout <<tt ; gotoxy(33,50); cout<<"Press any key to return to the main menu........"; getch() ; mainmenu();

void CHARGE::HELP() { clrscr(); textcolor(WHITE); cout<<"This is a petrol pump System program."; cout<<"\nIt can be used to : "; cout<<"\n1. View the Type of materials";

cout<<"\n2. Modify the charge structure of the material"; cout<<"\n3. View the charge structure of the materials in the form of a list"; cout<<"\nThe menu functions are described as follows"; cout<<"\n1. Price: This function displays the price slip for a given type"; cout<<"\nentered by the user. "; cout<<"\n2. MODIFY: This function modifies the price structure for a give type."; cout<<"\nThe user can change the prices for various materials"; cout<<"\n3. LIST: This function displays the list of total price for all the"; cout<<"\ntypes in the PETROL-PUMP "; cout<<"\nif you encounter any problems, just press ctrl+break. You will get out "; cout<<"\nof the program."; getch(); cout<<"\n\n\n\n\Press any key to continue..........."; getch(); mainmenu(); } //********************************************************** // MAIN FUNCTION TO CREATE MENU AND CALL OTHER FUNCTIONS //********************************************************** void main() { CHARGE charge; charge.ADDITION(); clrscr(); textcolor(MAGENTA); for(i=10;i<71;i++) { textcolor(MAGENTA); gotoxy(i,15); delay(30); printf("/"); } for(i=70;i>=10;i--) { gotoxy(i,22); delay(30); printf("\ "); } for(j=16;j<=21;j++) { gotoxy(10,j); delay(100); printf("-");

} for(j=21;j>=16;j--) { gotoxy(70,j); delay(100); printf("-"); } gotoxy(16,17); textcolor(BLINK + MAGENTA); cprintf(" Welcome To DIVYA'S PETROL-PUMP"); gotoxy(18,20); cprintf("Designed and Coded By DIVYA(B-TECH-CSE) 2009-2010"); gotoxy(18,21); textcolor(LIGHTGREEN); cprintf("\n Coded By : "); textcolor(3); cprintfDivya Mahajan: B.Tech (CSE)"); gotoxy(20,23); textcolor(WHITE); cprintf(" Press Any Key To ..........Continue"); getch(); mainmenu(); }

FEATURES OF PETROL PUMP MANAGEMENT SYSTEM

1.Integrated Solution:- Quicksoft art RM-PP is tightly integrated with accounting and inventory to givee up-to-date information and crucial actionable data on dues and stocks for follow-up,cost cutting and timely decision making. 2.Billing and Account:- The major function at any petrol pump is billing and accounting.Quicksoft,Art RM-PP has strong configurator to suit the needs of different pumps in terms of rate of interest being charged for over due and previous dues to be shown in invoice and accounting of the same in real time.Also the rounding off of invoice amount to be given customer wise and so on.

3.Bussiness Process:- Development of Art RM-PP is backed by the system study and knowledge sharing by various petrol pumps to understand the process being following at petrol pumps.The software takes care of meters reading,dip reading with calibration chart,slip entries and invoice generation seamlessly making it a smooth process flow and workflow to speed up the operation at the petrol pump.

BENEFITS OF PETROL PUMP MANAGEMENT SYSTEM


1.With automated cash sales entry,auto dip calculations using calibration chart,bulk invoice generation and option to adjust the receipt of payment against the particular invoice gives user billwise,vehicle wise outstanding,integrated accounting and inventory. 2.All in one with multi-functional and integrated bussiness processs to take care of their diverse needs of maintaining records for fuels dispensing,servicing of vehicles ,FMCG selling,accounting,invoicing and inventory being done in one single software freeing them to use multiple software for their daily needs. 3.Account processing charges are calculated as per the rate entered the customer. 4.with facility to create multiple tanks,multiple nozzeles,recursive group and subgroup creation to give comprehensive data visualization. 5.And online ledger,ageing of accounts,reports and MIS at finger tips leading to effective and improved decision making and with option to export the reports to various format and mails or fax reports makes it a free flow solution.

REFRENCES:1.www.google.com 2.www.wikipedia.com 3.www.ask.com 4.www.answer.com

BIBLIOGRAPHY:1.The complete refrence,C++ 2.E Balagurusamy,C++

Das könnte Ihnen auch gefallen