Click here to load reader

Computer science Investigatory Project Class 12 C++

  • View
    786

  • Download
    43

Embed Size (px)

Text of Computer science Investigatory Project Class 12 C++

  • 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

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    #include

  • 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.

    http://www.cplusplus.com/http://www.stackoverflow.com/

  • CODING //password is 'OIL BARON'

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    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);

    coutratepetrol;

    gotoxy(25,13);

    coutratedisel;

    while(m

  • cout

  • cout

  • strcpy(item,"Diesel");

    gotoxy(33,2);

    cout

  • 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

  • case 1: //Entry for 'in liters'

    gotoxy(10,9);

    coutratelub;

    gotoxy(10,10);

    coutlub;

    qty=lub;

    tlubric=lub+tlubric;

    charg=ratelub*lub;

    costlub=charg;

    tsalelubric=tsalelubric+charg;

    gotoxy(10,13);

    cout

  • 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

  • gotoxy(36,2);

    cout

  • cout

  • else

    charg=140;

    gotoxy(10,15);

    cout

  • gotoxy(12,15);

    cout

  • cout

  • gotoxy(30,12);

    cout

  • cout

  • cout

  • cout

  • gotoxy(71,row);

    cout

  • cout

  • gotoxy(37,15);

    cout

  • }

    ///////////////////////////////////////////////////////////////////////////////

    ///////

    /* ---------------- 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

  • OUTPUT