SlideShare una empresa de Scribd logo
1 de 48
Descargar para leer sin conexión
COMPUTER SCIENCE INVESTIGATORY
PROJECT
(2015-16)
NAME :RUSHIL AGGARWAL
CLASS : XII-A
ROLL NO :13
CERTIFICATE
This is to certified that the project has been satisfactorily performed by Master
RUSHIL AGGARWAL studying in NAVY CHILDREN SCHOOL of class XII-A under the
guidance of Mrs. Smera Girish during the academic year 2015-2016.
Signature of Head Of Department Signature of External Examiner
School Stamp
Acknowledgement
I would like to express my sincere gratitude to my
computer science Teacher Mrs. Smera Girish for their
vital support guidance and encouragement without
which this project would not have come forth from my
side.
I would like to express my heartily gratitude to the lab
incharge , Mr. Vaibhav for his support during the making
of this project .
I would like to thank my parents and friends who have
helped me with their valuable suggestions and guidance
has been helpful in various phases of the completion of
the project.
AIM
INTRODUCTION
HEADER FILES INCLUDED
CODING
OUTPUT
BIBLIOGRAPHY
Contents
AIM
TO CREATE A C++ PROGRAM FOR
PETROL PUMP MANAGEMENT SYSTEM
INTRODUCTION
This program is mainly intended for the various
activities that are carried out at the petrol pump and
service station. In this project we included about how
we can find out the information about the various
operations carried out at a petrol pump.
The program is sub-divided into 4 domains listed below
 Add new record
 Display all record
 Find a record
 Exit
Header Files Included
#include<iostream.h>
#include<ctype.h>
#include<string.h>
#include<stdio.h>
#include<dos.h>
#include<iomanip.h>
#include<fstream.h>
#include<process.h>
#include<conio.h>
Bibliography
1. www.google.com
2. www.en.wikipedia.org
3. www.cplusplus.com
4. www.stackoverflow.com
5. Computer Science Textbook class XI & XII –By
Sumita Arora.
CODING
//password is 'OIL BARON'
#include<ctype.h>
#include<string.h>
#include<stdio.h>
#include<dos.h>
#include<iomanip.h>
#include<iostream.h>
#include<fstream.h>
#include<process.h>
#include<conio.h>
class pump
{ private :
float totpet,tsalepet,charg,qty;
int totservice,tottyer,sno,pak;
float totdis,tsaledis,tlubric,ratepetrol,ratedisel;
float tsalelubric,tsalelubricpak,tsaleservice,tsaletyer,tlubricpak;
char no[15],item[10];
public:
void end();
void sale(float,float,float,float,float,float);
void stock(float,float,float,int,int,int);
void start();
int service();
void entry(float,float,char*);
int tyers();
void show();
void bill();
void find();
void getdata(char*,int,char *,float,float);
void bill(char
*,float,float,float,float,float,float,int,float,int,float,float);
void password();
}petrol;
void delay(unsigned long time);
void boder(char x);
///////////////////////////////////////////////////////////////////////////////
// MAIN FUNCTION //
///////////////////////////////////////////////////////////////////////////////
void main()
{
clrscr();
char no[15],item[10];
float ratepetrol,ratedisel,ratelub,costlub=0,lub=0,costpak;
float
costservice=0,costtyer=0,litpet=0,costpet=0,litdis=0,costdis=0;
int m=1,d,x=0,sno,choice,choicepet,choicedis,choicelubric;
int pak=0,totservice=0,tottyer=0;
float
totpet=0,tsalepet=0,totdis=0,tsaledis=0,tlubric=0,tsalelubric=0;
float tlubricpak=0,tsalelubricpak=0,tsaleservice=0,tsaletyer=0;
float charg,rs_pk=0,qty;
petrol.start(); //The Welcome screen
clrscr();
petrol.password(); //For Password
boder('#'); //For Border
gotoxy(25,10);
cout<<"Enter the rate of Petrol :: ";
cin>>ratepetrol;
gotoxy(25,13);
cout<<"Enter the rate of Diesel :: ";
cin>>ratedisel;
while(m<4)
{
clrscr();
boder('^');
gotoxy(25,8);
cout<<"Enter [ 1 ] for Add New Record ";
gotoxy(25,10);
cout<<"Enter [ 2 ] for Display All Records ";
gotoxy(25,12);
cout<<"Enter [ 3 ] for Find Any Record ";
gotoxy(25,14);
cout<<"Enter [ 4 ] for Exit ";
gotoxy(25,18);
cout<<"Enter Your Choice Here :: ";
cin>>m;
clrscr();
if(m==1) // TO ADD NEW RECORD
{
d=2;
fstream fill;
fill.open("petfile.dat",ios::app);
int i,j,k;
fill.seekg(0,ios::end);
i=fill.tellg();
j=sizeof(pump);
k=i/j;
j++;
sno=k+1;
gotoxy(10,3);
cout<<"N E W V E H I C L E ";
gotoxy(10,4);
cout<<"---------------------";
gotoxy(10,5);
cout<<"Service Number :: ";
cout<<sno;
gotoxy(10,7);
vno:
gotoxy(3,8);
cout<<"Please enter vehicle number in this format
[hr03c1234] only :: ";
gets(no);
if(strlen(no)==0)
{
gotoxy(10,12);
cout<<"Vehicle Number cannot left blank";
gotoxy(10,14);
cout<<"Enter Vehicle Number please....";
getch();
gotoxy(10,12);
clreol();
gotoxy(10,14);
clreol();
goto vno;
}
for(int r=0;no[r]!='0';r++) //loop to change name to uppercase
{
no[r]=toupper(no[r]);
}
litpet=costpet=litdis=costdis=lub=costlub=pak=rs_pk=x=costservice=costtyer=0;
while(d>1) //For exit control
{ clrscr();
petrol. entry(ratepetrol,ratedisel,no);
cin>>choice;
switch(choice)
{
case 1: //For Petrol entry
clrscr();
gotoxy(33,2);
strcpy(item,"Petrol");
cout<<"PETROL";
gotoxy(33,3);
cout<<"------nn";
gotoxy(10,5);
cout<<"Enter [ 1 ] for Litern ";
gotoxy(10,6);
cout<<"Enter [ 2 ] for Rupees ";
gotoxy(10,7);
cout<<"Enter Your Choice (1 or 2) :: ";
cin>>choicepet;
if(choicepet==1) //For entry in Liters(petrol)
{
gotoxy(10,10);
cout<<" How many liters :: ";
cin>>litpet;
totpet=totpet+litpet;
qty=litpet;
costpet=litpet*ratepetrol;
charg=costpet;
tsalepet=tsalepet+costpet;
gotoxy(10,12);
cout<<" Rupees. ";
cout.setf(ios::fixed);
cout<<setprecision(3)<<costpet<<" only ";
gotoxy(50,23);
cout<<"Press Enter key ";
getch();
}
if(choicepet==2) //For entry in Rupees(petrol)
{
gotoxy(10,10);
cout<<" How much Rupees :: ";
cin>>costpet;
charg=costpet;
tsalepet=tsalepet+costpet;
qty=costpet/ratepetrol;
litpet=qty;
totpet=totpet+qty;
gotoxy(10,12);
cout.setf(ios::fixed);
cout<<" Petrol filled "<<setprecision(2)<<qty<<"
liters";
gotoxy(50,23);
cout<<"Press Enter key ";
getch();
}
break;
case 2: //For Diesel entry
clrscr();
strcpy(item,"Diesel");
gotoxy(33,2);
cout<<"DIESEL";
gotoxy(33,3);
cout<<"------";
gotoxy(10,5);
cout<<"Enter [ 1 ] for Litern ";
gotoxy(10,6);
cout<<"Enter [ 2 ] for Rupees ";
gotoxy(10,7);
cout<<" n Enter your choice (1 or 2 ) :: ";
cin>>choicedis;
if(choicedis==1) //For entry in Liters(diesel)
{
gotoxy(10,10);
cout<<"How many liters :: ";
cin>>litdis;
totdis=totdis+litdis;
qty=litdis;
costdis =litdis*ratedisel;
charg=costdis;
tsaledis=tsaledis+costdis;
gotoxy(10,12);
cout.setf(ios::fixed);
cout<<"Rupees :"<<setprecision(2)<<costdis<<" only.";
gotoxy(50,23);
cout<<"Press Enter key ";
getch();
}
if(choicedis==2) //For entry in Rupees(diesel)
{
gotoxy(10,10);
cout<<" How much Rupees :: ";
cin>>costdis;
tsaledis=tsaledis+costdis;
charg=costdis;
qty=costdis/ratedisel;
litdis=qty;
totdis=totdis+qty;
gotoxy(10,12);
cout.setf(ios::fixed);
cout<<"Diesel filled = "<<setprecision(3)<<qty<<" liters ";
gotoxy(50,23);
cout<<"Press Enter key ";
getch();
}
break;
case 3: //Entry for Tyers and tube
clrscr();
strcpy(item,"Tyers");
charg=petrol.tyers();
costtyer=charg;
tottyer++;
tsaletyer=tsaletyer+charg;
gotoxy(50,23);
cout<<"Press Enter key ";
getch();
break;
case 4: //Entry for services
clrscr();
x++;
strcpy(item,"Service");
charg=petrol.service();
qty=0;
costservice=charg;
tsaleservice=charg+tsaleservice;
totservice++;
gotoxy(50,23);
cout<<"Press Enter key ";
getch();
break;
case 5: //Entry for lubricants
clrscr();
strcpy(item,"Lubricant");
gotoxy(33,2);
cout<<"LUBRICANTS";
gotoxy(33,3);
cout<<"----------";
gotoxy(10,5);
cout<<"Enter [ 1 ] for liter ";
gotoxy(10,6);
cout<<"Enter [ 2 ] for Packets";
gotoxy(10,7);
cout<<"Enter Your choice :: ";
cin>>choicelubric;
switch(choicelubric)
{
case 1: //Entry for 'in liters'
gotoxy(10,9);
cout<<"Rate of the oil ::";
cin>>ratelub;
gotoxy(10,10);
cout<<"How many liters :: ";
cin>>lub;
qty=lub;
tlubric=lub+tlubric;
charg=ratelub*lub;
costlub=charg;
tsalelubric=tsalelubric+charg;
gotoxy(10,13);
cout<<"The charges for ";
cout<< lub;
cout<<" liters oil :: ";
cout.setf(ios::fixed);
cout<<setprecision(3)<<charg<<" Rupees only.";
gotoxy(50,23);
cout<<"Press Enter key ";
getch();
break;
case 2: //Entry for 'in Rupees'
gotoxy(10,9);
cout<<"Enter the rate of one packet :: ";
cin>>costpak;
gotoxy(10,10);
cout<<"Enter how many packets you want to buy :: ";
cin>>pak;
qty=pak;
tlubricpak=tlubricpak+pak;
charg=pak*costpak;
rs_pk=charg;
tsalelubricpak=tsalelubricpak+charg;
gotoxy(10,13);
cout<<"The charges for the ";
cout<< pak;
cout<<" packets :: ";
cout.setf(ios::fixed);
cout<<setprecision(3)<<rs_pk<<" Rupees only";
gotoxy(50,23);
cout<<"Press Enter key ";
getch();
break;
}
break;
case 6: //for reveiw for the record(bill)
clrscr();
petrol.bill(no,litpet,costpet,litdis,costdis,lub,costlub,pak,rs_pk,x,
costservice,costtyer);
getch();
break;
case 7:
d=0; //for exit from entry record
break;
}
petrol.getdata(no,sno,item,qty,charg);
fill.write((char*)&petrol,sizeof(petrol));
fill.close();
}
}
if(m==2) //for displaying all records(in file)
{
clrscr();
petrol.show();
}
//for finding a record(in file)
if(m==3)
{
clrscr();
petrol.find();
getch();
}
if(m==4) //for exit from entry record
break;
}
petrol.sale(tsalepet,tsaledis,tsalelubric,tsalelubricpak,tsaleservice,tsaletyer
); // for day's sale
petrol.stock(totpet,totdis,tlubric,tlubricpak,totservice,tottyer);
//for day's stock usage
petrol.end();
} //for end display
//:::::::::::::::::::::::| functions |:::::::::::::::::::::::::::::://
/* ---------------- Function to display Start ---------------------------- */
void pump::start()
{
char a[10][42];
strcpy(a[1],"A P R O G R A M D E V L O P E D ");
strcpy(a[2],"F O R");
strcpy(a[3]," ");
strcpy(a[4],"P E T R O L P U M P M A N A G E M E N T");
strcpy(a[5]," ");
strcpy(a[6]," M A D E B Y");
strcpy(a[7],"R U S H I L A G G A R W A L , XII-A");
strcpy(a[8]," ");
int r=4;
for(int j=1;j<=8;j++)
{
int l=strlen(a[j]);
int x=((80-l)/2)+1;
gotoxy(x,r);
for(int p=0;p<l;p++)
{
putch(a[j][p]);
delay(1000);
}
delay(600);
r=r+2;
if(j==5)
r=r+2;
}
gotoxy(13,24);
cout<<"WAIT FOR MOMENT...";
delay(80000);
}
///////////////////////////////////////////////////////////////////////////////
///////
/* ---------------- Function to display Entry Menu --------------------------
-- */
void pump::entry(float x,float y,char *xx)
{
gotoxy(37,1);
cout<<"MENU";
gotoxy(36,2);
cout<<"------";
gotoxy(27,3);
cout<<"VEHICLE NUMBER :: ";
cout<<xx;
gotoxy(10,5);
cout<<"RATE OF PETROL :: Rs ";
cout.setf(ios::fixed);
cout<<setprecision(2)<<x;
gotoxy(45,5);
cout<<"RATE OF DIESEL :: Rs ";
cout<<setprecision(2)<<y;
gotoxy(30,8);
cout<<"ENTER [ 1 ] FOR PETROL ";
gotoxy(30,10);
cout<<"ENTER [ 2 ] FOR DIESEL ";
gotoxy(30,12);
cout<<"ENTER [ 3 ] FOR TYERS ";
gotoxy(30,14);
cout<<"ENTER [ 4 ] FOR SERVICE ";
gotoxy(30,16);
cout<<"ENTER [ 5 ] FOR LUCBRICANTS ";
gotoxy(30,18);
cout<<"ENTER [ 6 ] FOR DISPLAY CURRENT RECORD ";
gotoxy(30,20);
cout<<"ENTER [ 7 ] FOR EXIT FROM CURRENT RECORD ";
gotoxy(30,24);
cout<<"Enter Your choice :: ";
}
///////////////////////////////////////////////////////////////////////////////
///////
/* ---------------- Function to charge services ----------------------------
*/
int pump::service()
{
int ch,ch1,charg;
clrscr();
gotoxy(37,3);
cout<<"SERVICES";
gotoxy(37,4);
cout<<"--------";
gotoxy(10,6);
cout<<"Enter [ 1 ] For Washing ";
gotoxy(10,7);
cout<<"Enter [ 2 ] For Internal Cleaning ";
gotoxy(10,8);
cout<<"Enter [ 3 ] For Washing and Polishing ";
gotoxy(10,10);
cout<<"Enter Your choice (1 or 2 or 3) :: ";
cin>>ch;
clrscr();
switch(ch)
{
case 1:
gotoxy(10,7);
cout<<"Enter [ 1 ] For Two Wheeler ";
gotoxy(10,8);
cout<<"Enter [ 2 ] For Four Wheeler ";
gotoxy(10,10);
cout<<"Enter Your choice (1 or 2) :: ";
cin>>ch1;
if(ch1==1)
charg=50;
else
charg=90;
gotoxy(10,13);
cout<<"Washing Charges :: Rs ";
cout<<charg;
break;
case 2:
charg=180;
gotoxy(10,13);
cout<<"Inner Cleaning Charges :: Rs ";
cout<<charg;
break;
case 3:
gotoxy(10,7);
cout<<"Enter [ 1 ] For Two Wheeler n";
gotoxy(10,9);
cout<<"Enter [ 2 ] For Four Wheelern";
gotoxy(10,11);
cout<<"Enter Your Choice (1 or 2) :: ";
cin>>ch1;
if(ch1==1)
charg=60;
else
charg=140;
gotoxy(10,15);
cout<<"Washing and Polishing charges :: Rs ";
cout<<charg;
break;
}
return(charg);
}
///////////////////////////////////////////////////////////////////////////////
/////
/* ---------------- Function to display Stock Usage -------------------------
--- */
void pump::stock(float totpet,float totdis,float tlubric,int tlubricpak,int
totservice,int tottyer)
{
clrscr();
gotoxy(30,2);
cout<<"TODAY'S STOCK USAGE " ;
gotoxy(29,3);
cout<<"----------------------";
gotoxy(14,5);
cout<<"ITEM QUANTITY";
gotoxy(14,6);
cout<<"----- ------------";
gotoxy(12,8);
cout<<"PETROL ";
gotoxy(62,8);
cout<<totpet<<" ltr";
gotoxy(12,10);
cout<<"DIESEL ";
gotoxy(62,10);
cout<<totdis<<" ltr";
gotoxy(12,12);
cout<<"LUBRICANT 1) LITERS";
gotoxy(62,12);
cout<<tlubric<<" ltr";
gotoxy(21,13);
cout<<" 2) PACKETS USED";
gotoxy(62,13);
cout<<tlubricpak;
gotoxy(12,15);
cout<<"VEHICLES SERVICED";
gotoxy(62,15);
cout<<totservice;
gotoxy(12,17);
cout<<"TYERS USED";
gotoxy(62,17);
cout<<tottyer;
gotoxy(10,19);
cout<<"--------------------------------------------------------";
gotoxy(60,24);
cout<<"press any key...";
getch();
}
///////////////////////////////////////////////////////////////////////////////
///////
/* ---------------- Function to display Day's Sale --------------------------
-- */
void pump::sale(float tsalepet,float tsaledis,float tsalelubric,float
tsalelubricpak,float tsaleservice,float tsaletyer)
{ clrscr();
float sale=0;
sale=tsalepet+tsaledis+tsalelubric+tsalelubricpak+tsaleservice+tsaletyer;
gotoxy(30,2);
cout<<"TODAY'S SALE " ;
gotoxy(29,3);
cout<<"--------------";
gotoxy(14,5);
cout<<"ITEM RUPEES";
gotoxy(14,6);
cout<<"----- --------";
gotoxy(12,8);
cout<<"PETROL ";
gotoxy(62,8);
cout.setf(ios::fixed);
cout<<setprecision(2)<<tsalepet;
gotoxy(12,10);
cout<<"DIESEL ";
gotoxy(62,10);
cout<<setprecision(2)<<tsaledis;
gotoxy(12,12);
cout<<"LUBRICANT 1) LITERS";
gotoxy(62,12);
cout<<setprecision(2)<<tsalelubric;
gotoxy(21,13);
cout<<" 2) PACKETS ";
gotoxy(62,13);
cout<<setprecision(2)<<tsalelubricpak;
gotoxy(12,15);
cout<<"VEHICLES SERVICE";
gotoxy(62,15);
cout<<setprecision(2)<<tsaleservice;
gotoxy(12,17);
cout<<"TYERS";
gotoxy(62,17);
cout<<setprecision(2)<<tsaletyer;
gotoxy(10,19);
cout<<"--------------------------------------------------------";
gotoxy(51,21);
cout<<"CASH : ";
cout<<setprecision(2)<<sale;
gotoxy(50,22);
cout<<"-----";
gotoxy(60,24);
cout<<"press any key...";
getch();
}
///////////////////////////////////////////////////////////////////////////////
///////
/* ---------------- Function to display End ---------------------------- */
void pump::end()
{
clrscr();
boder('#');
gotoxy(26,8);
cout<<"T H A N K S F O R U S I N G";
gotoxy(36,10);
cout<<"T H I S";
gotoxy(30,12);
cout<<"P R O G R A M";
gotoxy(58,18);
cout<<"NAME- RUSHIL AGGARWAL";
gotoxy(58,20);
cout<<"CLASS- XII A";
gotoxy(58,22);
cout<<"ROLL No.- 13";
gotoxy(8,22);
cout<<"Press any key to exit ...";
getch();
}
///////////////////////////////////////////////////////////////////////////////
///////
/* ---------------- Function for tyer/tube purchase -------------------------
--- */
int pump::tyers()
{ int ty,choice,tb;
float rt,amount,amount1,rtb,charg;
gotoxy(5,3);
cout<<"Enter [ 1 ] For New Tyre ";
gotoxy(5,4);
cout<<"Enter [ 2 ] For Tube ";
gotoxy(5,5);
cout<<"Enter [ 3 ] For Tyre and Tube " ;
gotoxy(5,7);
cout<<"Enter your choice (1 or 2 or 3) :: ";
cin>>choice;
switch(choice)
{
case 1: //for tyers only
clrscr();
gotoxy(5,3);
cout<<"Enter no of tyers you want to buy :: ";
cin>>ty;
gotoxy(5,4);
cout<<"Cost per tyre :: Rs ";
cin>>rt;
amount=ty*rt;
gotoxy(5,6);
cout<<"The cost of ";
cout<<ty;
cout<<" tyers is :: Rs ";
cout.setf(ios::fixed);
cout<<setprecision(2)<<amount;
break;
case 2: //for tubes only
clrscr();
gotoxy(5,3);
cout<<"How many tubes want to buy :: ";
cin>>tb;
gotoxy(5,4);
cout<<"Cost per tube :: Rs ";
cin>>rtb;
amount=tb*rtb;
gotoxy(5,6);
cout<<"The cost of ";
cout<< tb;
cout<<" tube is :: Rs ";
cout.setf(ios::fixed);
cout<<setprecision(2)<<amount;
break;
case 3: //for tyers and tubes both
clrscr();
gotoxy(5,3);
cout<<"Enter no of tyers you want to buy :: ";
cin>>ty;
gotoxy(5,4);
cout<<"Cost of one tyre :: Rs ";
cin>>rt;
amount1=ty*rt;
gotoxy(5,5);
cout<<"The cost of ";
cout<<ty;
cout<<" tyers is :: Rs ";
cout.setf(ios::fixed);
cout<<setprecision(2)<<amount1;
gotoxy(5,7);
cout<<"How many tubes want to buy :: ";
cin>>tb;
gotoxy(5,8);
cout<<"Cost per tube :: Rs ";
cin>>rtb;
charg=tb*rtb;
gotoxy(5,9);
cout<<"The cost of ";
cout<<tb;
cout<<" tubes is :: Rs ";
cout<<setprecision(2)<<charg;
amount=charg+amount1;
gotoxy(5,12);
cout<<"Total charges for ";
cout<<ty;
cout<<" tyer and ";
cout<<tb;
cout<<"tube :: Rs ";
cout<<setprecision(2)<<amount;
break;
} return(amount);
}
///////////////////////////////////////////////////////////////////////////////
///////
/* ---------------- Function to find a record in file -----------------------
----- */
void pump::find()
{
char no1[15]; int y=0;
fstream file;
clrscr();
file.open("petfile.dat",ios::in|ios::out);
file.seekg(0,ios::beg);
clrscr();
gotoxy(4,6);
cout<<"ENTER VEHICLE NUMBER :: # ";
gets(no1);
for(int p=0;no1[p]!='0';p++)
{
no1[p]=toupper(no1[p]);
}
file.read((char*)&petrol,sizeof(petrol));
while(!file.eof())
{ if(strcmp(no1,no)==0)
{ y=8;
clrscr();
gotoxy(16,10);
cout<<"The record number is :: ";
cout<<sno;
gotoxy(16,12);
cout<<"Work done ";
cout<<item;
gotoxy(16,14);
cout<<"Charges ";
cout.setf(ios::fixed);
cout<<setprecision(2)<<charg;
getch();
}
file.read((char*)&petrol,sizeof(petrol));
}
file.close();
if(y==0)
{
gotoxy(30,12);
cout<<"No entry of this number ";
}
}
///////////////////////////////////////////////////////////////////////////////
///////
/* ---------------- Function to Display from a file -------------------------
--- */
void pump::show()
{
clrscr();
fstream file;
file.open("petfile.dat",ios::in,ios::out);
file.seekg(0,ios::beg);
int row = 3;
int flag = 0;
char ch;
gotoxy(1,1);
cout<<"S NO. VEHICLE NUMBER WORK DONE QTY
CHARGES";
gotoxy(1,2);
cout<<"-----------------------------------------------------------
----------------------";
while(file.read((char*)&petrol,sizeof(petrol)) )
{
flag = 0;
delay(1000);
gotoxy(3,row);
cout<<sno;
gotoxy(8,row);
cout<<no;
gotoxy(33,row);
cout<<item;
gotoxy(50,row);
cout.setf(ios::fixed);
cout<<setprecision(2)<<qty;
gotoxy(71,row);
cout<<setprecision(2)<<charg;
if( row == 23 )
{
flag = 1;
row = 3;
gotoxy(17,25);
cout<<"Press any key to go back to MAIN MENU....";
ch = getch();
if( ch == 27 )
break;
clrscr();
gotoxy(1,1);
cout<<"S NO. VEHICLE NUMBER WORK DONE QTY CHARGES ";
cout<<"------------------------------------------";
}
else
row = row + 2;
}
if(!flag)
{
gotoxy(20,25);
cout<<"Press any key to go back to MAIN MENU....";
getch();
}
file.close();
}
///////////////////////////////////////////////////////////////////////////////
/* ---------------- Function to assign values(s.number,quantity,charges) -----
----------- */
void pump:: getdata(char* no2,int sno1,char *item1,float qty1,float charg1)
{
strcpy(no,no2);
sno=sno1;
strcpy(item,item1);
qty=qty1;
charg=charg1;
}
///////////////////////////////////////////////////////////////////////////////
/* ---------------- Function to display Bill ---------------------------- */
void pump::bill(char *no,float litpet,float cpet,float litdis,float cdis,float
lubric,float clubric,int pak,float cpak,int service,float cservice,float ctyer)
{
clrscr();
float sale=0;
sale=cpet+cdis+clubric+cpak+cservice+ctyer;
gotoxy(27,1);
cout<<"INDIAN OIL PETROL PUMP AND SERVICE STATION " ;
gotoxy(26,2);
cout<<"---------------------------------------";
gotoxy(30,3);
cout<<"VECHICLE NUMBER # ";
cout<<no;
gotoxy(14,5);
cout<<"ITEM QUANTITY AMOUNT";
gotoxy(14,6);
cout<<"----- ---------- --------";
gotoxy(12,8);
cout<<"PETROL ";
gotoxy(37,8);
cout.setf(ios::fixed);
cout<<setprecision(2)<<litpet;
gotoxy(62,8);
cout<<setprecision(2)<<cpet;
gotoxy(12,10);
cout<<"DIESEL ";
gotoxy(37,10);
cout<<setprecision(2)<<litdis;
gotoxy(62,10);
cout<<setprecision(2)<<cdis;
gotoxy(12,12);
cout<<"LUBRICANT 1) LITERS";
gotoxy(37,12);
cout<<setprecision(2)<<lubric;
gotoxy(62,12);
cout<<setprecision(2)<<clubric;
gotoxy(21,13);
cout<<" 2) PACKETS ";
gotoxy(37,13);
cout<<setprecision(2)<<pak;
gotoxy(63,13);
cout<<setprecision(2)<<cpak;
gotoxy(12,15);
cout<<"SERVICE";
gotoxy(37,15);
cout<<setprecision(2)<<service;
gotoxy(62,15);
cout<<setprecision(4)<<cservice;
gotoxy(12,17);
cout<<"TYERS";
gotoxy(62,17);
cout<<setprecision(2)<<ctyer;
gotoxy(12,19);
cout<<"-----------------------------------------------------------";
gotoxy(51,21);
cout<<"CHARGES : ";
cout<<setprecision(4)<<sale;
gotoxy(50,22);
cout<<"--------";
}
///////////////////////////////////////////////////////////////////////////////
/* ---------------- Function for password verification ----------------------
------ */
void pump::password()
{
char pass[10]={"oil baron"};
char pass1[10];
X:
gotoxy(10,10);
cout<<"Enter password :: ";
gets(pass1);
gotoxy(10,11);
delay(8000);
if(!(strcmp(pass,pass1)==0))
{
gotoxy(20,19);
cout<<"Invalid password";
getch();
clrscr();
goto X;
}
gotoxy(20,22);
cout<<"Correct password ";
delay(80000);
clrscr();
}
///////////////////////////////////////////////////////////////////////////////
///////
/* ---------------- Function for a pause ---------------------------- */
void delay (unsigned long time )
{
while (time>0)
{
int i = 1333333; // This number is equivalent to 100 ms
while (i>0)
{
i--;
}
time--;
}
}
///////////////////////////////////////////////////////////////////////////////
///////////
/* ---------------- Function to display Boder ---------------------------- */
void boder(char x)
{
int i;
for(i=1;i<=80;i++)
{
gotoxy(i,1);
cout<<x;
delay(300);
}
for (i=2;i<=23;i++)
{
gotoxy(80,i);
cout<<x;
delay(300);
}
for (i=80;i>=1;i--)
{
gotoxy(i,24);
cout<<x;
delay(300);
}
for (i=23;i>=2;i--)
{
gotoxy(1,i);
cout<<x;
delay(300);
}
delay(1000);
}
OUTPUT
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++

Más contenido relacionado

La actualidad más candente

Computer Science investigatory project class 12
Computer Science investigatory project class 12Computer Science investigatory project class 12
Computer Science investigatory project class 12Raunak Yadav
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILEAnushka Rai
 
computer science with python project for class 12 cbse
computer science with python project for class 12 cbsecomputer science with python project for class 12 cbse
computer science with python project for class 12 cbsemanishjain598
 
Computer science investigatory project- computer shop
Computer science investigatory project- computer shopComputer science investigatory project- computer shop
Computer science investigatory project- computer shopYash Panwar
 
computer science project class 12th
computer science project class 12thcomputer science project class 12th
computer science project class 12thNitesh Kushwaha
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbsesiddharthjha34
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Self-employed
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12RithuJ
 
C++ project on police station software
C++ project on police station softwareC++ project on police station software
C++ project on police station softwaredharmenderlodhi021
 
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XIIYugenJarwal
 
Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22manyaarora19
 
CSc investigatory project
CSc investigatory projectCSc investigatory project
CSc investigatory projectDIVYANSHU KUMAR
 
computer science project for class 12 on telephone billing
computer science project for class 12 on telephone billingcomputer science project for class 12 on telephone billing
computer science project for class 12 on telephone billinganshi acharya
 
Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQLDarshit Vaghasiya
 
IP Project for Class 12th CBSE
IP Project for Class 12th CBSEIP Project for Class 12th CBSE
IP Project for Class 12th CBSESylvester Correya
 
class 12th computer science project Employee Management System In Python
 class 12th computer science project Employee Management System In Python class 12th computer science project Employee Management System In Python
class 12th computer science project Employee Management System In PythonAbhishekKumarMorla
 
C s investigatory project on telephone directory
C s  investigatory project on telephone directoryC s  investigatory project on telephone directory
C s investigatory project on telephone directorySHUBHAM YADAV
 
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Scott Wlaschin
 

La actualidad más candente (20)

Computer Science investigatory project class 12
Computer Science investigatory project class 12Computer Science investigatory project class 12
Computer Science investigatory project class 12
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
 
computer science with python project for class 12 cbse
computer science with python project for class 12 cbsecomputer science with python project for class 12 cbse
computer science with python project for class 12 cbse
 
Computer science investigatory project- computer shop
Computer science investigatory project- computer shopComputer science investigatory project- computer shop
Computer science investigatory project- computer shop
 
computer science project class 12th
computer science project class 12thcomputer science project class 12th
computer science project class 12th
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbse
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12
 
C++ project on police station software
C++ project on police station softwareC++ project on police station software
C++ project on police station software
 
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XII
 
Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22Complete practical file of class xii cs 2021-22
Complete practical file of class xii cs 2021-22
 
CSc investigatory project
CSc investigatory projectCSc investigatory project
CSc investigatory project
 
computer science project for class 12 on telephone billing
computer science project for class 12 on telephone billingcomputer science project for class 12 on telephone billing
computer science project for class 12 on telephone billing
 
Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQL
 
IP Project for Class 12th CBSE
IP Project for Class 12th CBSEIP Project for Class 12th CBSE
IP Project for Class 12th CBSE
 
class 12th computer science project Employee Management System In Python
 class 12th computer science project Employee Management System In Python class 12th computer science project Employee Management System In Python
class 12th computer science project Employee Management System In Python
 
List in java
List in javaList in java
List in java
 
C s investigatory project on telephone directory
C s  investigatory project on telephone directoryC s  investigatory project on telephone directory
C s investigatory project on telephone directory
 
Ip project
Ip projectIp project
Ip project
 
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Domain Driven Design with the F# type System -- F#unctional Londoners 2014
Domain Driven Design with the F# type System -- F#unctional Londoners 2014
 

Destacado

cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IPD. j Vicky
 
Contact Management System
Contact Management SystemContact Management System
Contact Management SystemGopal Bhat
 
Petrol station safety
Petrol station safetyPetrol station safety
Petrol station safetyZay Yar Tun
 
Hotel Management In C++
Hotel Management In C++Hotel Management In C++
Hotel Management In C++Amish Mhatre
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing Swakriti Rathore
 
Tic tac toe c++ project presentation
Tic tac toe c++ project presentationTic tac toe c++ project presentation
Tic tac toe c++ project presentationSaad Symbian
 
Hotel Management system in C++
Hotel Management system in C++ Hotel Management system in C++
Hotel Management system in C++ Prince Kumar
 
Library Management System
Library Management SystemLibrary Management System
Library Management SystemAditya Shah
 
12th bst project on marketing management
12th bst project on marketing management   12th bst project on marketing management
12th bst project on marketing management Jasmeet Singh
 

Destacado (12)

cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IP
 
Contact Management System
Contact Management SystemContact Management System
Contact Management System
 
Petrol station safety
Petrol station safetyPetrol station safety
Petrol station safety
 
Hotel Management In C++
Hotel Management In C++Hotel Management In C++
Hotel Management In C++
 
School Management (c++)
School Management (c++) School Management (c++)
School Management (c++)
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
Tic tac toe c++ project presentation
Tic tac toe c++ project presentationTic tac toe c++ project presentation
Tic tac toe c++ project presentation
 
Project report
Project reportProject report
Project report
 
Hotel Management system in C++
Hotel Management system in C++ Hotel Management system in C++
Hotel Management system in C++
 
Hotel Management System
Hotel Management SystemHotel Management System
Hotel Management System
 
Library Management System
Library Management SystemLibrary Management System
Library Management System
 
12th bst project on marketing management
12th bst project on marketing management   12th bst project on marketing management
12th bst project on marketing management
 

Similar a Computer science Investigatory Project Class 12 C++

Kirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third YearKirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third Yeardezyneecole
 
Reshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third YearReshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third Yeardezyneecole
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd marchRajeev Sharan
 
hitter !!!!!!!!!!!!!!!!!!!!!!!!
hitter !!!!!!!!!!!!!!!!!!!!!!!!hitter !!!!!!!!!!!!!!!!!!!!!!!!
hitter !!!!!!!!!!!!!!!!!!!!!!!!hiteshborha
 
Kajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearKajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearDezyneecole
 
c++ project
c++ projectc++ project
c++ projectTrish004
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQLvikram mahendra
 
Rounit Mathur , BCA Third Year
Rounit Mathur , BCA Third YearRounit Mathur , BCA Third Year
Rounit Mathur , BCA Third YearDezyneecole
 
Telephone billing system in c++
Telephone billing system in c++Telephone billing system in c++
Telephone billing system in c++vikram mahendra
 
Vinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearVinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearDezyneecole
 
Hardik Jadam , BCA Third Year
Hardik Jadam , BCA Third YearHardik Jadam , BCA Third Year
Hardik Jadam , BCA Third YearDezyneecole
 
Shivani Chouhan , BCA Third Year
Shivani Chouhan , BCA Third YearShivani Chouhan , BCA Third Year
Shivani Chouhan , BCA Third YearDezyneecole
 
Hardik Jadam , BCA Third Year
Hardik Jadam , BCA Third YearHardik Jadam , BCA Third Year
Hardik Jadam , BCA Third Yeardezyneecole
 
Vinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearVinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearDezyneecole
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearDezyneecole
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeKAI CHU CHUNG
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy codeShriKant Vashishtha
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearDezyneecole
 
Writing Go(od) Tests (FOSDEM 2020)
Writing Go(od) Tests (FOSDEM 2020)Writing Go(od) Tests (FOSDEM 2020)
Writing Go(od) Tests (FOSDEM 2020)Nikki Attea
 

Similar a Computer science Investigatory Project Class 12 C++ (20)

Kirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third YearKirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third Year
 
Reshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third YearReshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third Year
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
 
hitter !!!!!!!!!!!!!!!!!!!!!!!!
hitter !!!!!!!!!!!!!!!!!!!!!!!!hitter !!!!!!!!!!!!!!!!!!!!!!!!
hitter !!!!!!!!!!!!!!!!!!!!!!!!
 
Kajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearKajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third Year
 
c++ project
c++ projectc++ project
c++ project
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQL
 
Rounit Mathur , BCA Third Year
Rounit Mathur , BCA Third YearRounit Mathur , BCA Third Year
Rounit Mathur , BCA Third Year
 
Telephone billing system in c++
Telephone billing system in c++Telephone billing system in c++
Telephone billing system in c++
 
Vinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearVinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third Year
 
Hardik Jadam , BCA Third Year
Hardik Jadam , BCA Third YearHardik Jadam , BCA Third Year
Hardik Jadam , BCA Third Year
 
Shivani Chouhan , BCA Third Year
Shivani Chouhan , BCA Third YearShivani Chouhan , BCA Third Year
Shivani Chouhan , BCA Third Year
 
Hardik Jadam , BCA Third Year
Hardik Jadam , BCA Third YearHardik Jadam , BCA Third Year
Hardik Jadam , BCA Third Year
 
Vinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearVinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third Year
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third Year
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
 
Computer Practical XII
Computer Practical XIIComputer Practical XII
Computer Practical XII
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy code
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third Year
 
Writing Go(od) Tests (FOSDEM 2020)
Writing Go(od) Tests (FOSDEM 2020)Writing Go(od) Tests (FOSDEM 2020)
Writing Go(od) Tests (FOSDEM 2020)
 

Último

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 

Último (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 

Computer science Investigatory Project Class 12 C++

  • 1. COMPUTER SCIENCE INVESTIGATORY PROJECT (2015-16) NAME :RUSHIL AGGARWAL CLASS : XII-A ROLL NO :13
  • 2. CERTIFICATE This is to certified that the project has been satisfactorily performed by Master RUSHIL AGGARWAL studying in NAVY CHILDREN SCHOOL of class XII-A under the guidance of Mrs. Smera Girish during the academic year 2015-2016. Signature of Head Of Department Signature of External Examiner School Stamp
  • 3. Acknowledgement I would like to express my sincere gratitude to my computer science Teacher Mrs. Smera Girish for their vital support guidance and encouragement without which this project would not have come forth from my side. I would like to express my heartily gratitude to the lab incharge , Mr. Vaibhav for his support during the making of this project . I would like to thank my parents and friends who have helped me with their valuable suggestions and guidance has been helpful in various phases of the completion of the project.
  • 5. AIM TO CREATE A C++ PROGRAM FOR PETROL PUMP MANAGEMENT SYSTEM
  • 6. INTRODUCTION This program is mainly intended for the various activities that are carried out at the petrol pump and service station. In this project we included about how we can find out the information about the various operations carried out at a petrol pump. The program is sub-divided into 4 domains listed below  Add new record  Display all record  Find a record  Exit
  • 8. Bibliography 1. www.google.com 2. www.en.wikipedia.org 3. www.cplusplus.com 4. www.stackoverflow.com 5. Computer Science Textbook class XI & XII –By Sumita Arora.
  • 9. CODING //password is 'OIL BARON' #include<ctype.h> #include<string.h> #include<stdio.h> #include<dos.h> #include<iomanip.h> #include<iostream.h> #include<fstream.h> #include<process.h> #include<conio.h> class pump { private : float totpet,tsalepet,charg,qty; int totservice,tottyer,sno,pak; float totdis,tsaledis,tlubric,ratepetrol,ratedisel; float tsalelubric,tsalelubricpak,tsaleservice,tsaletyer,tlubricpak; char no[15],item[10]; public: void end(); void sale(float,float,float,float,float,float); void stock(float,float,float,int,int,int); void start(); int service(); void entry(float,float,char*); int tyers(); void show(); void bill(); void find(); void getdata(char*,int,char *,float,float); void bill(char *,float,float,float,float,float,float,int,float,int,float,float); void password(); }petrol; void delay(unsigned long time); void boder(char x); /////////////////////////////////////////////////////////////////////////////// // MAIN FUNCTION // /////////////////////////////////////////////////////////////////////////////// void main() { clrscr(); char no[15],item[10]; float ratepetrol,ratedisel,ratelub,costlub=0,lub=0,costpak; float costservice=0,costtyer=0,litpet=0,costpet=0,litdis=0,costdis=0; int m=1,d,x=0,sno,choice,choicepet,choicedis,choicelubric; int pak=0,totservice=0,tottyer=0;
  • 10. float totpet=0,tsalepet=0,totdis=0,tsaledis=0,tlubric=0,tsalelubric=0; float tlubricpak=0,tsalelubricpak=0,tsaleservice=0,tsaletyer=0; float charg,rs_pk=0,qty; petrol.start(); //The Welcome screen clrscr(); petrol.password(); //For Password boder('#'); //For Border gotoxy(25,10); cout<<"Enter the rate of Petrol :: "; cin>>ratepetrol; gotoxy(25,13); cout<<"Enter the rate of Diesel :: "; cin>>ratedisel; while(m<4) { clrscr(); boder('^'); gotoxy(25,8); cout<<"Enter [ 1 ] for Add New Record "; gotoxy(25,10); cout<<"Enter [ 2 ] for Display All Records "; gotoxy(25,12); cout<<"Enter [ 3 ] for Find Any Record "; gotoxy(25,14); cout<<"Enter [ 4 ] for Exit "; gotoxy(25,18); cout<<"Enter Your Choice Here :: "; cin>>m; clrscr(); if(m==1) // TO ADD NEW RECORD { d=2; fstream fill; fill.open("petfile.dat",ios::app); int i,j,k; fill.seekg(0,ios::end); i=fill.tellg(); j=sizeof(pump); k=i/j; j++; sno=k+1; gotoxy(10,3);
  • 11. cout<<"N E W V E H I C L E "; gotoxy(10,4); cout<<"---------------------"; gotoxy(10,5); cout<<"Service Number :: "; cout<<sno; gotoxy(10,7); vno: gotoxy(3,8); cout<<"Please enter vehicle number in this format [hr03c1234] only :: "; gets(no); if(strlen(no)==0) { gotoxy(10,12); cout<<"Vehicle Number cannot left blank"; gotoxy(10,14); cout<<"Enter Vehicle Number please...."; getch(); gotoxy(10,12); clreol(); gotoxy(10,14); clreol(); goto vno; } for(int r=0;no[r]!='0';r++) //loop to change name to uppercase { no[r]=toupper(no[r]); } litpet=costpet=litdis=costdis=lub=costlub=pak=rs_pk=x=costservice=costtyer=0; while(d>1) //For exit control { clrscr(); petrol. entry(ratepetrol,ratedisel,no); cin>>choice; switch(choice) { case 1: //For Petrol entry clrscr(); gotoxy(33,2); strcpy(item,"Petrol"); cout<<"PETROL"; gotoxy(33,3);
  • 12. cout<<"------nn"; gotoxy(10,5); cout<<"Enter [ 1 ] for Litern "; gotoxy(10,6); cout<<"Enter [ 2 ] for Rupees "; gotoxy(10,7); cout<<"Enter Your Choice (1 or 2) :: "; cin>>choicepet; if(choicepet==1) //For entry in Liters(petrol) { gotoxy(10,10); cout<<" How many liters :: "; cin>>litpet; totpet=totpet+litpet; qty=litpet; costpet=litpet*ratepetrol; charg=costpet; tsalepet=tsalepet+costpet; gotoxy(10,12); cout<<" Rupees. "; cout.setf(ios::fixed); cout<<setprecision(3)<<costpet<<" only "; gotoxy(50,23); cout<<"Press Enter key "; getch(); } if(choicepet==2) //For entry in Rupees(petrol) { gotoxy(10,10); cout<<" How much Rupees :: "; cin>>costpet; charg=costpet; tsalepet=tsalepet+costpet; qty=costpet/ratepetrol; litpet=qty; totpet=totpet+qty; gotoxy(10,12); cout.setf(ios::fixed); cout<<" Petrol filled "<<setprecision(2)<<qty<<" liters"; gotoxy(50,23); cout<<"Press Enter key "; getch(); } break; case 2: //For Diesel entry clrscr();
  • 13. strcpy(item,"Diesel"); gotoxy(33,2); cout<<"DIESEL"; gotoxy(33,3); cout<<"------"; gotoxy(10,5); cout<<"Enter [ 1 ] for Litern "; gotoxy(10,6); cout<<"Enter [ 2 ] for Rupees "; gotoxy(10,7); cout<<" n Enter your choice (1 or 2 ) :: "; cin>>choicedis; if(choicedis==1) //For entry in Liters(diesel) { gotoxy(10,10); cout<<"How many liters :: "; cin>>litdis; totdis=totdis+litdis; qty=litdis; costdis =litdis*ratedisel; charg=costdis; tsaledis=tsaledis+costdis; gotoxy(10,12); cout.setf(ios::fixed); cout<<"Rupees :"<<setprecision(2)<<costdis<<" only."; gotoxy(50,23); cout<<"Press Enter key "; getch(); } if(choicedis==2) //For entry in Rupees(diesel) { gotoxy(10,10); cout<<" How much Rupees :: "; cin>>costdis; tsaledis=tsaledis+costdis; charg=costdis; qty=costdis/ratedisel; litdis=qty; totdis=totdis+qty; gotoxy(10,12); cout.setf(ios::fixed); cout<<"Diesel filled = "<<setprecision(3)<<qty<<" liters "; gotoxy(50,23); cout<<"Press Enter key ";
  • 14. getch(); } break; case 3: //Entry for Tyers and tube clrscr(); strcpy(item,"Tyers"); charg=petrol.tyers(); costtyer=charg; tottyer++; tsaletyer=tsaletyer+charg; gotoxy(50,23); cout<<"Press Enter key "; getch(); break; case 4: //Entry for services clrscr(); x++; strcpy(item,"Service"); charg=petrol.service(); qty=0; costservice=charg; tsaleservice=charg+tsaleservice; totservice++; gotoxy(50,23); cout<<"Press Enter key "; getch(); break; case 5: //Entry for lubricants clrscr(); strcpy(item,"Lubricant"); gotoxy(33,2); cout<<"LUBRICANTS"; gotoxy(33,3); cout<<"----------"; gotoxy(10,5); cout<<"Enter [ 1 ] for liter "; gotoxy(10,6); cout<<"Enter [ 2 ] for Packets"; gotoxy(10,7); cout<<"Enter Your choice :: "; cin>>choicelubric; switch(choicelubric) {
  • 15. case 1: //Entry for 'in liters' gotoxy(10,9); cout<<"Rate of the oil ::"; cin>>ratelub; gotoxy(10,10); cout<<"How many liters :: "; cin>>lub; qty=lub; tlubric=lub+tlubric; charg=ratelub*lub; costlub=charg; tsalelubric=tsalelubric+charg; gotoxy(10,13); cout<<"The charges for "; cout<< lub; cout<<" liters oil :: "; cout.setf(ios::fixed); cout<<setprecision(3)<<charg<<" Rupees only."; gotoxy(50,23); cout<<"Press Enter key "; getch(); break; case 2: //Entry for 'in Rupees' gotoxy(10,9); cout<<"Enter the rate of one packet :: "; cin>>costpak; gotoxy(10,10); cout<<"Enter how many packets you want to buy :: "; cin>>pak; qty=pak; tlubricpak=tlubricpak+pak; charg=pak*costpak; rs_pk=charg; tsalelubricpak=tsalelubricpak+charg; gotoxy(10,13); cout<<"The charges for the "; cout<< pak; cout<<" packets :: "; cout.setf(ios::fixed); cout<<setprecision(3)<<rs_pk<<" Rupees only"; gotoxy(50,23); cout<<"Press Enter key "; getch(); break; } break;
  • 16. case 6: //for reveiw for the record(bill) clrscr(); petrol.bill(no,litpet,costpet,litdis,costdis,lub,costlub,pak,rs_pk,x, costservice,costtyer); getch(); break; case 7: d=0; //for exit from entry record break; } petrol.getdata(no,sno,item,qty,charg); fill.write((char*)&petrol,sizeof(petrol)); fill.close(); } } if(m==2) //for displaying all records(in file) { clrscr(); petrol.show(); } //for finding a record(in file) if(m==3) { clrscr(); petrol.find(); getch(); } if(m==4) //for exit from entry record break; } petrol.sale(tsalepet,tsaledis,tsalelubric,tsalelubricpak,tsaleservice,tsaletyer ); // for day's sale petrol.stock(totpet,totdis,tlubric,tlubricpak,totservice,tottyer); //for day's stock usage petrol.end(); } //for end display
  • 17. //:::::::::::::::::::::::| functions |::::::::::::::::::::::::::::::// /* ---------------- Function to display Start ---------------------------- */ void pump::start() { char a[10][42]; strcpy(a[1],"A P R O G R A M D E V L O P E D "); strcpy(a[2],"F O R"); strcpy(a[3]," "); strcpy(a[4],"P E T R O L P U M P M A N A G E M E N T"); strcpy(a[5]," "); strcpy(a[6]," M A D E B Y"); strcpy(a[7],"R U S H I L A G G A R W A L , XII-A"); strcpy(a[8]," "); int r=4; for(int j=1;j<=8;j++) { int l=strlen(a[j]); int x=((80-l)/2)+1; gotoxy(x,r); for(int p=0;p<l;p++) { putch(a[j][p]); delay(1000); } delay(600); r=r+2; if(j==5) r=r+2; } gotoxy(13,24); cout<<"WAIT FOR MOMENT..."; delay(80000); } /////////////////////////////////////////////////////////////////////////////// /////// /* ---------------- Function to display Entry Menu -------------------------- -- */ void pump::entry(float x,float y,char *xx) { gotoxy(37,1); cout<<"MENU";
  • 18. gotoxy(36,2); cout<<"------"; gotoxy(27,3); cout<<"VEHICLE NUMBER :: "; cout<<xx; gotoxy(10,5); cout<<"RATE OF PETROL :: Rs "; cout.setf(ios::fixed); cout<<setprecision(2)<<x; gotoxy(45,5); cout<<"RATE OF DIESEL :: Rs "; cout<<setprecision(2)<<y; gotoxy(30,8); cout<<"ENTER [ 1 ] FOR PETROL "; gotoxy(30,10); cout<<"ENTER [ 2 ] FOR DIESEL "; gotoxy(30,12); cout<<"ENTER [ 3 ] FOR TYERS "; gotoxy(30,14); cout<<"ENTER [ 4 ] FOR SERVICE "; gotoxy(30,16); cout<<"ENTER [ 5 ] FOR LUCBRICANTS "; gotoxy(30,18); cout<<"ENTER [ 6 ] FOR DISPLAY CURRENT RECORD "; gotoxy(30,20); cout<<"ENTER [ 7 ] FOR EXIT FROM CURRENT RECORD "; gotoxy(30,24); cout<<"Enter Your choice :: "; } /////////////////////////////////////////////////////////////////////////////// /////// /* ---------------- Function to charge services ---------------------------- */ int pump::service() { int ch,ch1,charg; clrscr(); gotoxy(37,3); cout<<"SERVICES"; gotoxy(37,4);
  • 19. cout<<"--------"; gotoxy(10,6); cout<<"Enter [ 1 ] For Washing "; gotoxy(10,7); cout<<"Enter [ 2 ] For Internal Cleaning "; gotoxy(10,8); cout<<"Enter [ 3 ] For Washing and Polishing "; gotoxy(10,10); cout<<"Enter Your choice (1 or 2 or 3) :: "; cin>>ch; clrscr(); switch(ch) { case 1: gotoxy(10,7); cout<<"Enter [ 1 ] For Two Wheeler "; gotoxy(10,8); cout<<"Enter [ 2 ] For Four Wheeler "; gotoxy(10,10); cout<<"Enter Your choice (1 or 2) :: "; cin>>ch1; if(ch1==1) charg=50; else charg=90; gotoxy(10,13); cout<<"Washing Charges :: Rs "; cout<<charg; break; case 2: charg=180; gotoxy(10,13); cout<<"Inner Cleaning Charges :: Rs "; cout<<charg; break; case 3: gotoxy(10,7); cout<<"Enter [ 1 ] For Two Wheeler n"; gotoxy(10,9); cout<<"Enter [ 2 ] For Four Wheelern"; gotoxy(10,11); cout<<"Enter Your Choice (1 or 2) :: "; cin>>ch1; if(ch1==1) charg=60;
  • 20. else charg=140; gotoxy(10,15); cout<<"Washing and Polishing charges :: Rs "; cout<<charg; break; } return(charg); } /////////////////////////////////////////////////////////////////////////////// ///// /* ---------------- Function to display Stock Usage ------------------------- --- */ void pump::stock(float totpet,float totdis,float tlubric,int tlubricpak,int totservice,int tottyer) { clrscr(); gotoxy(30,2); cout<<"TODAY'S STOCK USAGE " ; gotoxy(29,3); cout<<"----------------------"; gotoxy(14,5); cout<<"ITEM QUANTITY"; gotoxy(14,6); cout<<"----- ------------"; gotoxy(12,8); cout<<"PETROL "; gotoxy(62,8); cout<<totpet<<" ltr"; gotoxy(12,10); cout<<"DIESEL "; gotoxy(62,10); cout<<totdis<<" ltr"; gotoxy(12,12); cout<<"LUBRICANT 1) LITERS"; gotoxy(62,12); cout<<tlubric<<" ltr"; gotoxy(21,13); cout<<" 2) PACKETS USED"; gotoxy(62,13); cout<<tlubricpak;
  • 21. gotoxy(12,15); cout<<"VEHICLES SERVICED"; gotoxy(62,15); cout<<totservice; gotoxy(12,17); cout<<"TYERS USED"; gotoxy(62,17); cout<<tottyer; gotoxy(10,19); cout<<"--------------------------------------------------------"; gotoxy(60,24); cout<<"press any key..."; getch(); } /////////////////////////////////////////////////////////////////////////////// /////// /* ---------------- Function to display Day's Sale -------------------------- -- */ void pump::sale(float tsalepet,float tsaledis,float tsalelubric,float tsalelubricpak,float tsaleservice,float tsaletyer) { clrscr(); float sale=0; sale=tsalepet+tsaledis+tsalelubric+tsalelubricpak+tsaleservice+tsaletyer; gotoxy(30,2); cout<<"TODAY'S SALE " ; gotoxy(29,3); cout<<"--------------"; gotoxy(14,5); cout<<"ITEM RUPEES"; gotoxy(14,6); cout<<"----- --------"; gotoxy(12,8); cout<<"PETROL "; gotoxy(62,8); cout.setf(ios::fixed); cout<<setprecision(2)<<tsalepet; gotoxy(12,10); cout<<"DIESEL "; gotoxy(62,10);
  • 22. cout<<setprecision(2)<<tsaledis; gotoxy(12,12); cout<<"LUBRICANT 1) LITERS"; gotoxy(62,12); cout<<setprecision(2)<<tsalelubric; gotoxy(21,13); cout<<" 2) PACKETS "; gotoxy(62,13); cout<<setprecision(2)<<tsalelubricpak; gotoxy(12,15); cout<<"VEHICLES SERVICE"; gotoxy(62,15); cout<<setprecision(2)<<tsaleservice; gotoxy(12,17); cout<<"TYERS"; gotoxy(62,17); cout<<setprecision(2)<<tsaletyer; gotoxy(10,19); cout<<"--------------------------------------------------------"; gotoxy(51,21); cout<<"CASH : "; cout<<setprecision(2)<<sale; gotoxy(50,22); cout<<"-----"; gotoxy(60,24); cout<<"press any key..."; getch(); } /////////////////////////////////////////////////////////////////////////////// /////// /* ---------------- Function to display End ---------------------------- */ void pump::end() { clrscr(); boder('#'); gotoxy(26,8); cout<<"T H A N K S F O R U S I N G"; gotoxy(36,10); cout<<"T H I S";
  • 23. gotoxy(30,12); cout<<"P R O G R A M"; gotoxy(58,18); cout<<"NAME- RUSHIL AGGARWAL"; gotoxy(58,20); cout<<"CLASS- XII A"; gotoxy(58,22); cout<<"ROLL No.- 13"; gotoxy(8,22); cout<<"Press any key to exit ..."; getch(); } /////////////////////////////////////////////////////////////////////////////// /////// /* ---------------- Function for tyer/tube purchase ------------------------- --- */ int pump::tyers() { int ty,choice,tb; float rt,amount,amount1,rtb,charg; gotoxy(5,3); cout<<"Enter [ 1 ] For New Tyre "; gotoxy(5,4); cout<<"Enter [ 2 ] For Tube "; gotoxy(5,5); cout<<"Enter [ 3 ] For Tyre and Tube " ; gotoxy(5,7); cout<<"Enter your choice (1 or 2 or 3) :: "; cin>>choice; switch(choice) { case 1: //for tyers only clrscr(); gotoxy(5,3); cout<<"Enter no of tyers you want to buy :: "; cin>>ty; gotoxy(5,4); cout<<"Cost per tyre :: Rs "; cin>>rt; amount=ty*rt; gotoxy(5,6); cout<<"The cost of ";
  • 24. cout<<ty; cout<<" tyers is :: Rs "; cout.setf(ios::fixed); cout<<setprecision(2)<<amount; break; case 2: //for tubes only clrscr(); gotoxy(5,3); cout<<"How many tubes want to buy :: "; cin>>tb; gotoxy(5,4); cout<<"Cost per tube :: Rs "; cin>>rtb; amount=tb*rtb; gotoxy(5,6); cout<<"The cost of "; cout<< tb; cout<<" tube is :: Rs "; cout.setf(ios::fixed); cout<<setprecision(2)<<amount; break; case 3: //for tyers and tubes both clrscr(); gotoxy(5,3); cout<<"Enter no of tyers you want to buy :: "; cin>>ty; gotoxy(5,4); cout<<"Cost of one tyre :: Rs "; cin>>rt; amount1=ty*rt; gotoxy(5,5); cout<<"The cost of "; cout<<ty; cout<<" tyers is :: Rs "; cout.setf(ios::fixed); cout<<setprecision(2)<<amount1; gotoxy(5,7); cout<<"How many tubes want to buy :: "; cin>>tb; gotoxy(5,8); cout<<"Cost per tube :: Rs "; cin>>rtb; charg=tb*rtb; gotoxy(5,9); cout<<"The cost of "; cout<<tb;
  • 25. cout<<" tubes is :: Rs "; cout<<setprecision(2)<<charg; amount=charg+amount1; gotoxy(5,12); cout<<"Total charges for "; cout<<ty; cout<<" tyer and "; cout<<tb; cout<<"tube :: Rs "; cout<<setprecision(2)<<amount; break; } return(amount); } /////////////////////////////////////////////////////////////////////////////// /////// /* ---------------- Function to find a record in file ----------------------- ----- */ void pump::find() { char no1[15]; int y=0; fstream file; clrscr(); file.open("petfile.dat",ios::in|ios::out); file.seekg(0,ios::beg); clrscr(); gotoxy(4,6); cout<<"ENTER VEHICLE NUMBER :: # "; gets(no1); for(int p=0;no1[p]!='0';p++) { no1[p]=toupper(no1[p]); } file.read((char*)&petrol,sizeof(petrol)); while(!file.eof()) { if(strcmp(no1,no)==0) { y=8; clrscr(); gotoxy(16,10); cout<<"The record number is :: "; cout<<sno; gotoxy(16,12); cout<<"Work done "; cout<<item; gotoxy(16,14);
  • 26. cout<<"Charges "; cout.setf(ios::fixed); cout<<setprecision(2)<<charg; getch(); } file.read((char*)&petrol,sizeof(petrol)); } file.close(); if(y==0) { gotoxy(30,12); cout<<"No entry of this number "; } } /////////////////////////////////////////////////////////////////////////////// /////// /* ---------------- Function to Display from a file ------------------------- --- */ void pump::show() { clrscr(); fstream file; file.open("petfile.dat",ios::in,ios::out); file.seekg(0,ios::beg); int row = 3; int flag = 0; char ch; gotoxy(1,1); cout<<"S NO. VEHICLE NUMBER WORK DONE QTY CHARGES"; gotoxy(1,2); cout<<"----------------------------------------------------------- ----------------------"; while(file.read((char*)&petrol,sizeof(petrol)) ) { flag = 0; delay(1000); gotoxy(3,row); cout<<sno; gotoxy(8,row); cout<<no; gotoxy(33,row); cout<<item; gotoxy(50,row); cout.setf(ios::fixed); cout<<setprecision(2)<<qty;
  • 27. gotoxy(71,row); cout<<setprecision(2)<<charg; if( row == 23 ) { flag = 1; row = 3; gotoxy(17,25); cout<<"Press any key to go back to MAIN MENU...."; ch = getch(); if( ch == 27 ) break; clrscr(); gotoxy(1,1); cout<<"S NO. VEHICLE NUMBER WORK DONE QTY CHARGES "; cout<<"------------------------------------------"; } else row = row + 2; } if(!flag) { gotoxy(20,25); cout<<"Press any key to go back to MAIN MENU...."; getch(); } file.close(); } /////////////////////////////////////////////////////////////////////////////// /* ---------------- Function to assign values(s.number,quantity,charges) ----- ----------- */ void pump:: getdata(char* no2,int sno1,char *item1,float qty1,float charg1) { strcpy(no,no2); sno=sno1; strcpy(item,item1); qty=qty1; charg=charg1; } /////////////////////////////////////////////////////////////////////////////// /* ---------------- Function to display Bill ---------------------------- */ void pump::bill(char *no,float litpet,float cpet,float litdis,float cdis,float lubric,float clubric,int pak,float cpak,int service,float cservice,float ctyer) { clrscr(); float sale=0; sale=cpet+cdis+clubric+cpak+cservice+ctyer; gotoxy(27,1);
  • 28. cout<<"INDIAN OIL PETROL PUMP AND SERVICE STATION " ; gotoxy(26,2); cout<<"---------------------------------------"; gotoxy(30,3); cout<<"VECHICLE NUMBER # "; cout<<no; gotoxy(14,5); cout<<"ITEM QUANTITY AMOUNT"; gotoxy(14,6); cout<<"----- ---------- --------"; gotoxy(12,8); cout<<"PETROL "; gotoxy(37,8); cout.setf(ios::fixed); cout<<setprecision(2)<<litpet; gotoxy(62,8); cout<<setprecision(2)<<cpet; gotoxy(12,10); cout<<"DIESEL "; gotoxy(37,10); cout<<setprecision(2)<<litdis; gotoxy(62,10); cout<<setprecision(2)<<cdis; gotoxy(12,12); cout<<"LUBRICANT 1) LITERS"; gotoxy(37,12); cout<<setprecision(2)<<lubric; gotoxy(62,12); cout<<setprecision(2)<<clubric; gotoxy(21,13); cout<<" 2) PACKETS "; gotoxy(37,13); cout<<setprecision(2)<<pak; gotoxy(63,13); cout<<setprecision(2)<<cpak; gotoxy(12,15); cout<<"SERVICE";
  • 29. gotoxy(37,15); cout<<setprecision(2)<<service; gotoxy(62,15); cout<<setprecision(4)<<cservice; gotoxy(12,17); cout<<"TYERS"; gotoxy(62,17); cout<<setprecision(2)<<ctyer; gotoxy(12,19); cout<<"-----------------------------------------------------------"; gotoxy(51,21); cout<<"CHARGES : "; cout<<setprecision(4)<<sale; gotoxy(50,22); cout<<"--------"; } /////////////////////////////////////////////////////////////////////////////// /* ---------------- Function for password verification ---------------------- ------ */ void pump::password() { char pass[10]={"oil baron"}; char pass1[10]; X: gotoxy(10,10); cout<<"Enter password :: "; gets(pass1); gotoxy(10,11); delay(8000); if(!(strcmp(pass,pass1)==0)) { gotoxy(20,19); cout<<"Invalid password"; getch(); clrscr(); goto X; } gotoxy(20,22); cout<<"Correct password "; delay(80000); clrscr();
  • 30. } /////////////////////////////////////////////////////////////////////////////// /////// /* ---------------- Function for a pause ---------------------------- */ void delay (unsigned long time ) { while (time>0) { int i = 1333333; // This number is equivalent to 100 ms while (i>0) { i--; } time--; } } /////////////////////////////////////////////////////////////////////////////// /////////// /* ---------------- Function to display Boder ---------------------------- */ void boder(char x) { int i; for(i=1;i<=80;i++) { gotoxy(i,1); cout<<x; delay(300); } for (i=2;i<=23;i++) { gotoxy(80,i); cout<<x; delay(300); } for (i=80;i>=1;i--) { gotoxy(i,24); cout<<x; delay(300); } for (i=23;i>=2;i--) { gotoxy(1,i); cout<<x; delay(300); } delay(1000); }