Shopping Mall Management

download Shopping Mall Management

of 31

Transcript of Shopping Mall Management

  • 8/8/2019 Shopping Mall Management

    1/31

    TERM PAPERON

    Shoping mall management system?

    Object oriented programming

    SUBMITTED TO:-

    Ms.manjit kaur

    SUBMITTED BY:-

    VISHEK VERMA

    RC1804AO4

    B.TECH M.TECH (INTEGRAGRATED)

    10801337

  • 8/8/2019 Shopping Mall Management

    2/31

    Acknowledgements

    As the professional courses do not only required the theoretical

    knowledge but need to cover practical aspect too. Universities

    have started conducting training programs for students. So, that

    they get simple view of practical knowledge.

    No work of significance can be claimed on a result of an individual

    Effort and same holds true further for this project as well, for

    through it carries my name the energy of many have contributed

    in no small measure in completion of this project.

    I am very thankful to my friend and our teacher ms MANJIT

    KAUR who help me to make this project.

    Project Description:

    n this project, we will be designing a simple shopping mall using object oriented

    echnology. The mall will provide a soothing shopping experience for customers,

    while at the same time allowing us to explore design patterns and other features object

    oriented technology.

  • 8/8/2019 Shopping Mall Management

    3/31

    The prototype presented allows customers to purchase productsfrom all the shops in the Mall.

    SORCE CODE

    My project is an practicle project and can be used in real life..

    #include

    #include

    #include

    #include

    #include#include

    struct dt

    {

    int dd,mm,yy;

    };

    date d;

    class menu

    {public:

    void main_menu();

    void Items();

    void Shops();

    void transaction();

    };

    class issue_return

    {

    int m_code,b_code;dt id;

    char status;

    public:

    int return_bcode()

    {

    return(b_code);

    }

    int return_mcode()

    {

  • 8/8/2019 Shopping Mall Management

    4/31

    return(m_code);

    }

    void issue_Item();

    void return_Item();

    void list_Item();

    };

    class Shop

    {

    char name[25],Floor[25];

    int code,Number;

    public:

    void add_Shop();

    void delete_Shop();

    void search_Shop();

    void update_Shop();void list_Shop();

    int return_code2();

    };

    class member

    {

    char name[25],Floor[30];

    int code,Number;

    public:

    void add_member();

    void delete_member();

    void search_member();

    void update_member();

    void list_member();

    int return_code1();

    int ret_code()

    {

    return(code);

    }

    };

    class Item

    {

    int code,num_of_quantity;

    char title[20];

    float price;

    public:

    void add_Item();

    void delete_Item();

  • 8/8/2019 Shopping Mall Management

    5/31

    void search_Item();

    void update_Item();

    void list_Item();

    int return_code();

    int ret_quantity()

    { return(num_of_quantity);

    }

    void increase_quantity()

    {

    num_of_quantity++;

    }

    void reduce_quantity()

    {

    num_of_quantity--;

    }

    int ret_bcode(){

    return code;

    }

    };

    int Shop::return_code2()

    {

    int c=0;

    ifstream obj("Shop.DAT");

    if(!obj)

    {

    return 0;

    }

    while(!obj.eof())

    {

    obj.read((char*)this,sizeof(Shop));

    c=code;

    }

    obj.close();

    return(c);

    }

    void Shop::add_Shop()

    {

    int d,m;

    d=DETECT;

    initgraph(&d,&m,"\\tc\\bgi");

    cleardevice();

  • 8/8/2019 Shopping Mall Management

    6/31

    setcolor(YELLOW);

    rectangle(5,10,630,100);

    setfillstyle(SOLID_FILL,YELLOW);

    floodfill(15,15,YELLOW);

    setcolor(RED);

    settextstyle(7,0,5);outtextxy(120,30,"ADD NEW Shop");

    ofstream obj;

    code=return_code2()+1;

    obj.open("Shop.DAT",ios::app);

    if(!obj)

    {

    cout

  • 8/8/2019 Shopping Mall Management

    7/31

    obj.open("Shop.DAT");

    if(!obj)

    {

    cout

  • 8/8/2019 Shopping Mall Management

    8/31

    settextstyle(7,0,5);

    outtextxy(120,30,"SEARCH Shop");

    int code1,f=0;

    gotoxy(22,7);

    coutcode1;ifstream obj;

    obj.open("Shop.DAT");

    if(!obj)

    {

    gotoxy(30,10);

    cout

  • 8/8/2019 Shopping Mall Management

    9/31

    void Shop::delete_Shop()

    {

    int d,m;

    d=DETECT;

    initgraph(&d,&m,"");

    cleardevice();setcolor(YELLOW);

    rectangle(5,10,630,100);

    setfillstyle(SOLID_FILL,YELLOW);

    floodfill(15,15,YELLOW);

    setcolor(RED);

    settextstyle(7,0,5);

    outtextxy(130,30,"DELETE Shop");

    int code2,f=0;

    ifstream obj("Shop.DAT");

    ofstream obj1("TEMP.DAT");

    if(!obj) {

    cout

  • 8/8/2019 Shopping Mall Management

    10/31

    cout

  • 8/8/2019 Shopping Mall Management

    11/31

    if(code2==code)

    {

    f=1;

    gotoxy(30,10);

    cout

  • 8/8/2019 Shopping Mall Management

    12/31

    c=code;

    }

    obj.close();

    return(c);

    }

    void Item::add_Item()

    {

    int d,m;

    d=DETECT;

    initgraph(&d,&m,"\\tc\\bgi");

    cleardevice();

    setcolor(YELLOW);

    rectangle(5,10,630,100);

    setfillstyle(SOLID_FILL,YELLOW);

    floodfill(15,15,YELLOW);setcolor(RED);

    settextstyle(7,0,5);

    outtextxy(130,30,"ADD NEW Item");

    ofstream obj;

    code=return_code()+1;

    obj.open("Item.DAT",ios::app);

    if(!obj)

    {

    cout

  • 8/8/2019 Shopping Mall Management

    13/31

    d=DETECT;

    initgraph(&d,&m,"\\tc\\bgi");

    cleardevice();

    setcolor(YELLOW);

    rectangle(5,10,630,100);

    setfillstyle(SOLID_FILL,YELLOW);floodfill(15,15,YELLOW);

    setcolor(RED);

    settextstyle(7,0,5);

    outtextxy(120,30,"LIST OF Items");

    int a=11;

    ifstream obj;

    obj.open("Item.DAT");

    if(!obj)

    {

    cout

  • 8/8/2019 Shopping Mall Management

    14/31

    d=DETECT;

    initgraph(&d,&m,"\\tc\\bgi");

    cleardevice();

    setcolor(YELLOW);

    rectangle(5,10,630,100);

    setfillstyle(SOLID_FILL,YELLOW);floodfill(15,15,YELLOW);

    setcolor(RED);

    settextstyle(7,0,5);

    outtextxy(160,30,"SEARCH Item");

    int code1,f=0;

    gotoxy(22,7);

    coutcode1;

    ifstream obj;

    obj.open("Item.DAT");

    if(!obj){

    cout

  • 8/8/2019 Shopping Mall Management

    15/31

    void Item::delete_Item()

    {

    int d,m;d=DETECT;

    initgraph(&d,&m,"\\tc\\bgi");

    cleardevice();

    setcolor(YELLOW);

    rectangle(5,10,630,100);

    setfillstyle(SOLID_FILL,YELLOW);

    floodfill(15,15,YELLOW);

    setcolor(RED);

    settextstyle(7,0,5);

    outtextxy(170,30,"MAIN MENU");

    int code2,f=0;ifstream obj("Item.DAT");

    ofstream obj1("TEMP.DAT");

    if(!obj)

    {

    cout

  • 8/8/2019 Shopping Mall Management

    16/31

    if(f==0)

    {

    gotoxy(30,14);

    cout

  • 8/8/2019 Shopping Mall Management

    17/31

    if(obj.eof())

    break;

    if(code2==code)

    {

    f=1;gotoxy(30,12);

    cout

  • 8/8/2019 Shopping Mall Management

    18/31

    member mem;

    date d;

    int f=0;

    Item o;

    int cd,cd1;

    ifstream obj;obj.open("STUDENT.DAT");

    if(!obj)

    {

    cout

  • 8/8/2019 Shopping Mall Management

    19/31

    while(!obj.eof())

    {

    obj.read((char*)&o,sizeof(Item));

    if(obj.eof())

    break;

    if(cd1==o.ret_bcode()){

    if(o.ret_quantity()>0)

    {

    f=1;

    gotoxy(30,12);

    cout

  • 8/8/2019 Shopping Mall Management

    20/31

    obj.close();

    obj1.close();

    remove("Item.DAT");

    rename("TEMP.DAT","Item.DAT");

    m_code=cd;

    b_code=cd1;

    ofstream obj2("issue.dat",ios::app);

    if(!obj2)

    {

    cout

  • 8/8/2019 Shopping Mall Management

    21/31

    cout

  • 8/8/2019 Shopping Mall Management

    22/31

    {

    obj.read((char*)this,sizeof(issue_return));

    if(obj.eof())

    break;

    if(cd==m_code&&cd1==b_code)

    {

    f=1;

    break;

    }

    }

    obj.close();

    if(f==0)

    {

    gotoxy(30,12);

    cout

  • 8/8/2019 Shopping Mall Management

    23/31

    obj1.close();

    remove("Item.DAT");

    rename("TEMP.DAT","Item.DAT");

    ifstream obj3;

    obj3.open("ISSUE.DAT");

    obj1.open("TEMP.DAT");

    obj3.seekg(0);

    while(!obj.eof())

    {

    obj3.read((char*)this,sizeof(issue_return));

    if(obj3.eof())

    break;

    if(cd==m_code&&cd1==b_code)status='R';

    obj1.write((char*)this,sizeof(issue_return));

    }

    obj3.close();

    obj1.close();

    remove("ISSUE.DAT");

    rename("TEMP.DAT","ISSUE.DAT");

    }

    void menu::main_menu()

    {

    int choice,choice1;

    do

    {

    int d,m;

    d=DETECT;

    initgraph(&d,&m,"\\tc\\bgi");

    cleardevice();

    setcolor(YELLOW);

    rectangle(5,10,630,100);

    setfillstyle(SOLID_FILL,YELLOW);

    floodfill(15,15,YELLOW);

    setcolor(RED);

    settextstyle(7,0,5);

    outtextxy(170,30,"MAIN MENU");

    gotoxy(30,9);

    cout

  • 8/8/2019 Shopping Mall Management

    24/31

    gotoxy(30,11);

    cout

  • 8/8/2019 Shopping Mall Management

    25/31

    delay(2500);

    }

    }while(choice1!=4);

    closegraph();

    }

    void menu::Items()

    {

    int choice,choice1;

    Item o;

    do

    {

    int d,m;

    d=DETECT;

    initgraph(&d,&m,"\\tc\\bgi");cleardevice();

    setcolor(YELLOW);

    rectangle(5,10,630,100);

    setfillstyle(SOLID_FILL,YELLOW);

    floodfill(15,15,YELLOW);

    setcolor(RED);

    settextstyle(7,0,5);

    outtextxy(170,30,"Item MENU");

    gotoxy(30,8);

    cout

  • 8/8/2019 Shopping Mall Management

    26/31

    o.add_Item();

    break;

    case 2:

    clrscr();

    gotoxy(30,11);

    o.delete_Item();break;

    case 3:

    clrscr();

    gotoxy(30,12);

    o.search_Item();

    break;

    case 4:

    clrscr();

    gotoxy(30,13);

    o.update_Item();

    break;case 5:

    clrscr();

    gotoxy(30,14);

    o.list_Item();

    break;

    case 6:

    clrscr();

    gotoxy(30,15);

    return;

    case 7:

    clrscr();

    exit(0);

    break;

    default:

    cleardevice();

    setbkcolor(YELLOW);

    setcolor(RED);

    settextstyle(7,0,3);

    outtextxy(15,150,"WRONG ENTRY

    PLEASE RE-ENTER YOUR CHOICE.");

    delay(2500);

    }

    }while(choice1!=6);

    closegraph();

    }

    void menu::Shops()

    {

    Shop emp;

    int choice,choice1;

  • 8/8/2019 Shopping Mall Management

    27/31

    do

    {

    clrscr();

    int d,m;

    d=DETECT;

    initgraph(&d,&m,"\\tc\\bgi");cleardevice();

    setcolor(YELLOW);

    rectangle(5,10,630,100);

    setfillstyle(SOLID_FILL,YELLOW);

    floodfill(15,15,YELLOW);

    setcolor(RED);

    settextstyle(7,0,5);

    outtextxy(110,30,"Shop MENU");

    gotoxy(30,8);

    cout

  • 8/8/2019 Shopping Mall Management

    28/31

    emp.search_Shop();

    break;

    case 4:

    clrscr();

    gotoxy(30,10);

    emp.update_Shop();break;

    case 5:

    gotoxy(30,10);

    emp.list_Shop();

    break;

    case 6:

    clrscr();

    gotoxy(30,14);

    return;

    case 7:

    clrscr();exit(0);

    break;

    default:

    cleardevice();

    setbkcolor(YELLOW);

    setcolor(RED);

    settextstyle(7,0,3);

    outtextxy(15,150,"WRONG ENTRY

    PLEASE RE-ENTER YOUR CHOICE.");

    delay(2500);

    }

    }while(choice1!=6);

    closegraph();

    }

    void menu::transaction()

    {

    issue_return issue;

    int choice,choice1;

    do

    {

    clrscr();

    int d,m;

    d=DETECT;

    initgraph(&d,&m,"\\tc\\bgi");

    cleardevice();

    setcolor(YELLOW);

    rectangle(5,10,630,100);

    setfillstyle(SOLID_FILL,YELLOW);

  • 8/8/2019 Shopping Mall Management

    29/31

    floodfill(15,15,YELLOW);

    setcolor(RED);

    settextstyle(7,0,5);

    outtextxy(80,30,"ISSUE-RETURN MENU");

    gotoxy(30,11);

    cout

  • 8/8/2019 Shopping Mall Management

    30/31

    default:

    cleardevice();

    setbkcolor(YELLOW);

    setcolor(RED);

    settextstyle(7,0,3);outtextxy(15,150,"WRONG ENTRY

    PLEASE RE-ENTER YOUR CHOICE.");

    delay(2500);

    }

    }while(choice1!=4);

    closegraph();

    }

    void main()

    {

    int d,m,j,left=0,top=220,bottom=240;

    d=DETECT;

    initgraph(&d,&m,"\\tc\\bgi");

    cleardevice();

    for(int i=440;i>=-250;i--)

    {

    cleardevice();

    setcolor(3);

    settextjustify(1,1);

    setusercharsize(1,0,1,0);

    outtextxy(245,i,"WELCOME TO");

    outtextxy(220,i+20,"SHOPING MALL

    MANAGMENT");

    outtextxy(260,i+40,"SYSTEM");

    setcolor(3);

    settextjustify(1,1);

    setusercharsize(1,0,1,0);

    outtextxy(250,i+200,"MADE BY");

    outtextxy(220,i+220,"VISHEK VERMA");

    outtextxy(170,i+240,"COMPUTER SCIENCE");

    outtextxy(125,i+480,"LOVELY PROFESSIONAL

    UNIVERSITY,PUNJAB");

    delay(25);

    }

    for(i=0;i-20,j

  • 8/8/2019 Shopping Mall Management

    31/31

    {

    rectangle(left,i,650,j);

    delay(10);

    }

    settextstyle(1,0,4);

    setcolor(4);outtextxy(300,230,"THANK YOU");

    getch();

    closegraph();

    menu me;

    me.main_menu();

    getch();

    }