SlideShare a Scribd company logo
1 of 22
MINI PROJECT
             CSE205
TOPIC:Graphical reperesntation of stack



Submitted by:
SANJAY KUMAR CHAKRAVARTI
ROLL:A28
SEC:K2R13
                      Submitted to:
                  Miss.Deepika sukhija
                      Dept. cse
                      Lpu,phagwara
Acknowledgement


Apart from the efforts of me, the success of this project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express
my gratitude to the people who have been instrumental in the successful
completion of this project.

I would like to show my greatest appreciation to Miss. Deepika sukhija I can’t say
thank you enough for his tremendous support and help. I feel motivated and
encouraged every time I attend his meeting. Without his encouragement and
guidance this project would not have materialized.

The guidance and support received from all the team members including Mr.
sanjeev kumar and Mr. Abhay kumar who contributed and are contributing to this
project, was vital for the success of the project. I am grateful for their constant
support and help.
CONTENT


TOPIC                                                   PAGE NO.
 .
1 ABSTRACT-------------------------------------------------- 04

2. INTRODUCTION------------------------------------------- 05
3.SOURCE CODE---------------------------------------------- 06-18
4.OUTPUTS------------------------------------------------------ 19-21
4.REFRENCES-------------------------------------------------- 22
ABSTRACT

This project was very important for me. In this project I have
show a graphical view of stacks for better understanding. It will
gives you many features as listed below:
  1. Graphical view
  2. Simple programming language
  3. Source code contains comments line where needed
  4. A best approach with graphics programming
INTRODUCTION


The Stack is a Memory Area where you can store data there and can get
back them again. In computer science, a stack is a last in, first out
(LIFO) abstract data type and linear data structure . A stack can have
any abstract data type as an element , but is characterized by two
fundamental operations, called PUSH and POP. The push operation adds
a new item to the top of the stack, or initializes the stack if it is empty. If
the stack is full and does not contain enough space to accept the given
item, the stack is then considered to be in an overflow state. The pop
operation removes an item from the top of the stack. A pop either
reveals previously concealed items, or results in an empty stack, but if
the stack is empty then it goes into underflow state (It means no items
are present in stack to be removed). A stack is a restricted data
structure , because only a small number of operations are performed on
it. The nature of the pop and push operations also means that stack
elements have a natural order. Elements are removed from the stack in
the reverse order to the order of their addition: therefore, the lower
elements are those that have been on the stack the longest.
Source code


#include<iostream.h>     //for cin, cout

#include<conio.h>      //for getche()

#include<ctype.h>      //for tolower() function

#include<stdlib.h>     //for itoa()

#include<GRAPHICS.H>          //to load graphics driver

#include<dos.h>    //for delay() function
/*_________________________________________________________________
________*//*_______________________________________________________
__________________*///These Functions prototypes are, for stack function.

int col=60 , row = 417 ,n ,x=60 , y=417 ,size=10
,arr[10]={12,56,23,46,32,89,11,99,12,66} , count = 0, top = 0;   //Global
Variables

char string[45];

void push( );

void pop( );

void stack();
void loadgraph();



void main()

{

clrscr();

char ch;

struct fillsettingstype fillinfo;



loadgraph();

setbkcolor(0);

setcolor(2);

do

{

rectangle(2,2,620,410);

rectangle(4,4,618,408);

line(0,30,620,30);

getfillsettings(&fillinfo);

line(0,32,620,32);

line(100,32,100,410);

moveto(180,15);

outtext("SANJAY KUMAR CHAKRAVARTI");

// circle(300,120,110);
setbkcolor(12);

gotoxy(37,5);

cout<<"Menu";

gotoxy(30,6);

cout<<"Stack        [s]";

gotoxy(30,8);

cout<<"Exit        [x]";

gotoxy(30,10);

cout<<"Enter Option [ ]";

ch=getche();

ch = tolower(ch);

gotoxy(30,15);

if(ch=='s')

stack();



}while(ch!='x');

cleardevice();

closegraph();

}

void loadgraph()

{

    clrscr();

    int driver = DETECT, mode, errorcode;
initgraph(&driver, &mode, "c:tcbgi");

    errorcode = graphresult();

    if (errorcode != grOk)

     {

     cout<<"Graphics error: n"<<(grapherrormsg(errorcode));

     cout<<"Press any key to halt:";

     getch();

     exit(1);

     }

}

void stack()

{

    cleardevice();

     moveto(400,60);

    outtext("STACK'S OPERATIONS");

    moveto(400,80);

    outtext("PUSH            [p]");

    moveto(400,100);

    outtext("POP         [o]");

    moveto(400,120);

    outtext("EXIT        [x]");

    moveto(300,125);

    outtext("Top");
itoa(top,string,10);

line(150,0,150,415);

outtextxy(308,450,string);

setbkcolor(3);

setcolor(14);

outtextxy(55,26,"NOW STACK:");

line(30,40,30,440);

int r=40;

for(int i = 1 ;i<12 ;i++)

{

    line(30,r,110,r);

    r+=40;

}

line(110,40,110,440);

r = 55;

for( i = 10 ;i>=1 ;i--)

{

    moveto(10,r);

    itoa(i,string,10);

    outtext(string) ;

    r+=40;

}

line(165,440,210,440);
line(165,440,165,460);

 line(210,440,210,460);

 line(165,460,210,460);

 setfillstyle(0, getmaxcolor());

char ch[2];

 do

  {

   moveto(400,140);

   outtext("ENTER OPTION ");

   ch[0]=getche();

   ch[0] = tolower(ch[0]);

   if(ch[0]=='p')

  { outtext("p");

      delay(500);

      bar(getx()-30,gety(),getx()+2,gety()+20);

if(size<1)

        {

        for(int i = 0 ;i<4 ; i++){

            moveto(420,170);

            outtext("Stack Overflow ");

            delay(1000);

            setfillstyle(0, getmaxcolor());

            bar(420 ,165 ,630 ,180);
delay(500);}

       }

else if( size>1)



       {

        size--;

        top++;

        push();

        bar(290,440,350,479);

        itoa(top,string,10);

        outtextxy(308,447,string);

        }}//end of Nested if

 else if(ch[0]=='o')




 {



     outtext("o");

     delay(500);

     bar(getx()-30,gety(),getx()+10,gety()+20);

if(size==10)

       {

        for(int i = 0 ;i<4 ; i++){
moveto(410,170);

            outtext("Stack, Underflow ");

            delay(1000);

            setfillstyle(0, getmaxcolor());

            bar(330 ,165 ,630 ,180);

            delay(500); }

            }

     else

            {

            top--;

            pop();

            bar(290,440,350,479);

            itoa(top,string,10);

            outtextxy(308,447,string);

            }

            }

}

while(ch[0]!='x');

}



void push()

{

    int a=178 , b=425       ;
moveto(178,447);

 itoa(arr[count],string,10);

 outtext(string);

 delay(10);

 bar(170,446,208,455);

 itoa(arr[count+1],string,10);

 moveto(178,447);

 outtext(string);

 moveto(a,b);

while(gety()!=y)

  {

   setfillstyle(0, getmaxcolor());

   circle(a+6,b+3,12);

   itoa(arr[count],string,10);

   outtext(string);

   delay(10);

   setfillstyle(0, getmaxcolor());

   bar(170 ,gety()-20 ,200 ,gety()+14);

   moveto(a,b);

   b--;

  }

 setfillstyle(0, getmaxcolor());

 circle(a+6,b+3,9);
outtext(string);

 moveto(125,b);

for(int j =0 ;j<6 ; j++)

   {

  outtext("<<--");

  delay(100);

  setfillstyle(0, getmaxcolor());

  bar(getx()-3 ,gety() ,getx() ,gety()+8);

  delay(100);

   }

delay(100);

 setfillstyle(0, getmaxcolor());

 bar(getx()-48 ,gety() ,getx() ,gety()+8);

delay(100);     delay(200);

while(getx()!=x+60)

   {

   setfillstyle(0, getmaxcolor());

   circle(a+6,b+3,9);

   itoa(arr[count],string,10);

   outtext(string);

   delay(10);

   setfillstyle(0, getmaxcolor());

   bar(getx()-20 ,gety()-10 ,getx()+70 ,gety()+20);
moveto(a,b);

         a--;

     }

    delay(100);

    moveto(60,gety());

    outtext(string);

    count++;

    y = y-40;

}

void pop()

{

    int a=120, b ;

    y = y + 40 ;

    b=y         ;

    moveto(120,y);

for(int j=0 ;j<6 ; j++)

     {

     outtext("®");

     delay(100);

     setfillstyle(0, getmaxcolor());

     bar(getx()-3 ,gety() ,getx() ,gety()+8);

     delay(100);

     }
delay(100);

setfillstyle(0, getmaxcolor());

bar(getx()-48 ,gety() ,getx() ,gety()+8);

delay(200);

moveto(60,gety());

setfillstyle(0, getmaxcolor());

bar(getx()-10 ,gety()-3 ,getx()+20 ,gety()+8);

delay(500);

while(getx()!=178)

 {

 setfillstyle(0, getmaxcolor());

 circle(a+6,b+3,12);

 moveto(a,gety());

 itoa(arr[count-1],string,10);

 outtext(string);

 delay(10);

 setfillstyle(0, getmaxcolor());

 bar(getx()-25 ,gety()-10 ,getx()+30 ,gety()+20);

 a++;

 }

delay(500);

while(gety()!=430)

 {
setfillstyle(0, getmaxcolor());

    circle(a+21,b+3,7);

    moveto(178,b);

    itoa(arr[count-1],string,10);

    outtext(string);

    delay(10);

    setfillstyle(0, getmaxcolor());

    bar(getx()-30 ,gety()-10 ,getx()+20 ,gety()+9);

    b++;

    }

    delay(10);

    moveto(178,447);

    bar(170,446,208,455);

    count--;

    moveto(178,447);

    itoa(arr[count],string,10);

    outtext(string);

    size++;

}
OUTPUTS

1.Menu list:




2.Operations in stack:
3.Push Operation:




4.Pop Operations:
REFRENCES

1. http://en.wikipedia.org/wiki/Stack_(abstract_data_type)

2. www.cprogrramming.com/stack_graphics

More Related Content

What's hot

SQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTIONSQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTIONArun Sial
 
Virtual function in C++ Pure Virtual Function
Virtual function in C++ Pure Virtual Function Virtual function in C++ Pure Virtual Function
Virtual function in C++ Pure Virtual Function Kamlesh Makvana
 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basicsmsemenistyi
 
Introduction to PL/SQL
Introduction to PL/SQLIntroduction to PL/SQL
Introduction to PL/SQLKailash N
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming conceptsrahuld115
 
Late and Early binding in c++
Late and Early binding in c++Late and Early binding in c++
Late and Early binding in c++FazalRehman79
 
collection framework in java
collection framework in javacollection framework in java
collection framework in javaMANOJ KUMAR
 
Quicksort Algorithm..simply defined through animations..!!
Quicksort Algorithm..simply defined through animations..!!Quicksort Algorithm..simply defined through animations..!!
Quicksort Algorithm..simply defined through animations..!!Mahesh Tibrewal
 
Command line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorialCommand line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorialKuntal Bhowmick
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQLrehaniltifat
 

What's hot (20)

SQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTIONSQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTION
 
Virtual function in C++ Pure Virtual Function
Virtual function in C++ Pure Virtual Function Virtual function in C++ Pure Virtual Function
Virtual function in C++ Pure Virtual Function
 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basics
 
Introduction to PL/SQL
Introduction to PL/SQLIntroduction to PL/SQL
Introduction to PL/SQL
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming concepts
 
Packages - PL/SQL
Packages - PL/SQLPackages - PL/SQL
Packages - PL/SQL
 
PL/SQL TRIGGERS
PL/SQL TRIGGERSPL/SQL TRIGGERS
PL/SQL TRIGGERS
 
Polymorphism in oop
Polymorphism in oopPolymorphism in oop
Polymorphism in oop
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 
Late and Early binding in c++
Late and Early binding in c++Late and Early binding in c++
Late and Early binding in c++
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
 
Inheritance In Java
Inheritance In JavaInheritance In Java
Inheritance In Java
 
D3 data visualization
D3 data visualizationD3 data visualization
D3 data visualization
 
collection framework in java
collection framework in javacollection framework in java
collection framework in java
 
Quicksort Algorithm..simply defined through animations..!!
Quicksort Algorithm..simply defined through animations..!!Quicksort Algorithm..simply defined through animations..!!
Quicksort Algorithm..simply defined through animations..!!
 
Linked list
Linked listLinked list
Linked list
 
Command line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorialCommand line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorial
 
Chapter 2 Java Methods
Chapter 2 Java MethodsChapter 2 Java Methods
Chapter 2 Java Methods
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
 

Similar to Graphical representation of Stack

Documento de acrobat2
Documento de acrobat2Documento de acrobat2
Documento de acrobat2fraytuck
 
include ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfinclude ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfcontact32
 
Drawing on canvas
Drawing on canvasDrawing on canvas
Drawing on canvassuitzero
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical filePranav Ghildiyal
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File Rahul Chugh
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring CanvasKevin Hoyt
 
[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노Chiwon Song
 
C Code and the Art of Obfuscation
C Code and the Art of ObfuscationC Code and the Art of Obfuscation
C Code and the Art of Obfuscationguest9006ab
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
Why Go Scales
Why Go ScalesWhy Go Scales
Why Go ScalesEyal Post
 
Im trying again -Okay, Im in need of some help - this is the c.pdf
Im trying again -Okay, Im in need of some help - this is the c.pdfIm trying again -Okay, Im in need of some help - this is the c.pdf
Im trying again -Okay, Im in need of some help - this is the c.pdfeyeonsecuritysystems
 
Data structures lab manual
Data structures lab manualData structures lab manual
Data structures lab manualSyed Mustafa
 

Similar to Graphical representation of Stack (20)

Theme verdadeiro
Theme verdadeiroTheme verdadeiro
Theme verdadeiro
 
Documento de acrobat2
Documento de acrobat2Documento de acrobat2
Documento de acrobat2
 
Blocks+gcd入門
Blocks+gcd入門Blocks+gcd入門
Blocks+gcd入門
 
include ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfinclude ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdf
 
Drawing on canvas
Drawing on canvasDrawing on canvas
Drawing on canvas
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File
 
C program
C programC program
C program
 
Exploring Canvas
Exploring CanvasExploring Canvas
Exploring Canvas
 
[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노[3] 프로세싱과 아두이노
[3] 프로세싱과 아두이노
 
C Code and the Art of Obfuscation
C Code and the Art of ObfuscationC Code and the Art of Obfuscation
C Code and the Art of Obfuscation
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Pdxpugday2010 pg90
Pdxpugday2010 pg90Pdxpugday2010 pg90
Pdxpugday2010 pg90
 
Why Go Scales
Why Go ScalesWhy Go Scales
Why Go Scales
 
Arrays
ArraysArrays
Arrays
 
Vcs23
Vcs23Vcs23
Vcs23
 
Im trying again -Okay, Im in need of some help - this is the c.pdf
Im trying again -Okay, Im in need of some help - this is the c.pdfIm trying again -Okay, Im in need of some help - this is the c.pdf
Im trying again -Okay, Im in need of some help - this is the c.pdf
 
Data structures lab manual
Data structures lab manualData structures lab manual
Data structures lab manual
 
05 queues
05 queues05 queues
05 queues
 

More from Sanjay Kumar Chakravarti

More from Sanjay Kumar Chakravarti (8)

IMPLEMENTATION OF AUTO KEY IN C++
IMPLEMENTATION OF AUTO KEY IN C++IMPLEMENTATION OF AUTO KEY IN C++
IMPLEMENTATION OF AUTO KEY IN C++
 
Design A Screen saver in c on Moving Train with Side view.
Design A Screen saver in c on Moving Train with Side view.Design A Screen saver in c on Moving Train with Side view.
Design A Screen saver in c on Moving Train with Side view.
 
Design A Screen saver in c on Moving Train with Side view.
Design A Screen saver in c on Moving Train with Side view.Design A Screen saver in c on Moving Train with Side view.
Design A Screen saver in c on Moving Train with Side view.
 
Microassembler a10
Microassembler a10Microassembler a10
Microassembler a10
 
Micro Assembler
Micro AssemblerMicro Assembler
Micro Assembler
 
Design problem
Design problemDesign problem
Design problem
 
Computer Network
Computer NetworkComputer Network
Computer Network
 
Structured Analysis and Structured Design
Structured Analysis and Structured DesignStructured Analysis and Structured Design
Structured Analysis and Structured Design
 

Recently uploaded

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 

Recently uploaded (20)

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

Graphical representation of Stack

  • 1. MINI PROJECT CSE205 TOPIC:Graphical reperesntation of stack Submitted by: SANJAY KUMAR CHAKRAVARTI ROLL:A28 SEC:K2R13 Submitted to: Miss.Deepika sukhija Dept. cse Lpu,phagwara
  • 2. Acknowledgement Apart from the efforts of me, the success of this project depends largely on the encouragement and guidelines of many others. I take this opportunity to express my gratitude to the people who have been instrumental in the successful completion of this project. I would like to show my greatest appreciation to Miss. Deepika sukhija I can’t say thank you enough for his tremendous support and help. I feel motivated and encouraged every time I attend his meeting. Without his encouragement and guidance this project would not have materialized. The guidance and support received from all the team members including Mr. sanjeev kumar and Mr. Abhay kumar who contributed and are contributing to this project, was vital for the success of the project. I am grateful for their constant support and help.
  • 3. CONTENT TOPIC PAGE NO. . 1 ABSTRACT-------------------------------------------------- 04 2. INTRODUCTION------------------------------------------- 05 3.SOURCE CODE---------------------------------------------- 06-18 4.OUTPUTS------------------------------------------------------ 19-21 4.REFRENCES-------------------------------------------------- 22
  • 4. ABSTRACT This project was very important for me. In this project I have show a graphical view of stacks for better understanding. It will gives you many features as listed below: 1. Graphical view 2. Simple programming language 3. Source code contains comments line where needed 4. A best approach with graphics programming
  • 5. INTRODUCTION The Stack is a Memory Area where you can store data there and can get back them again. In computer science, a stack is a last in, first out (LIFO) abstract data type and linear data structure . A stack can have any abstract data type as an element , but is characterized by two fundamental operations, called PUSH and POP. The push operation adds a new item to the top of the stack, or initializes the stack if it is empty. If the stack is full and does not contain enough space to accept the given item, the stack is then considered to be in an overflow state. The pop operation removes an item from the top of the stack. A pop either reveals previously concealed items, or results in an empty stack, but if the stack is empty then it goes into underflow state (It means no items are present in stack to be removed). A stack is a restricted data structure , because only a small number of operations are performed on it. The nature of the pop and push operations also means that stack elements have a natural order. Elements are removed from the stack in the reverse order to the order of their addition: therefore, the lower elements are those that have been on the stack the longest.
  • 6. Source code #include<iostream.h> //for cin, cout #include<conio.h> //for getche() #include<ctype.h> //for tolower() function #include<stdlib.h> //for itoa() #include<GRAPHICS.H> //to load graphics driver #include<dos.h> //for delay() function /*_________________________________________________________________ ________*//*_______________________________________________________ __________________*///These Functions prototypes are, for stack function. int col=60 , row = 417 ,n ,x=60 , y=417 ,size=10 ,arr[10]={12,56,23,46,32,89,11,99,12,66} , count = 0, top = 0; //Global Variables char string[45]; void push( ); void pop( ); void stack();
  • 7. void loadgraph(); void main() { clrscr(); char ch; struct fillsettingstype fillinfo; loadgraph(); setbkcolor(0); setcolor(2); do { rectangle(2,2,620,410); rectangle(4,4,618,408); line(0,30,620,30); getfillsettings(&fillinfo); line(0,32,620,32); line(100,32,100,410); moveto(180,15); outtext("SANJAY KUMAR CHAKRAVARTI"); // circle(300,120,110);
  • 8. setbkcolor(12); gotoxy(37,5); cout<<"Menu"; gotoxy(30,6); cout<<"Stack [s]"; gotoxy(30,8); cout<<"Exit [x]"; gotoxy(30,10); cout<<"Enter Option [ ]"; ch=getche(); ch = tolower(ch); gotoxy(30,15); if(ch=='s') stack(); }while(ch!='x'); cleardevice(); closegraph(); } void loadgraph() { clrscr(); int driver = DETECT, mode, errorcode;
  • 9. initgraph(&driver, &mode, "c:tcbgi"); errorcode = graphresult(); if (errorcode != grOk) { cout<<"Graphics error: n"<<(grapherrormsg(errorcode)); cout<<"Press any key to halt:"; getch(); exit(1); } } void stack() { cleardevice(); moveto(400,60); outtext("STACK'S OPERATIONS"); moveto(400,80); outtext("PUSH [p]"); moveto(400,100); outtext("POP [o]"); moveto(400,120); outtext("EXIT [x]"); moveto(300,125); outtext("Top");
  • 10. itoa(top,string,10); line(150,0,150,415); outtextxy(308,450,string); setbkcolor(3); setcolor(14); outtextxy(55,26,"NOW STACK:"); line(30,40,30,440); int r=40; for(int i = 1 ;i<12 ;i++) { line(30,r,110,r); r+=40; } line(110,40,110,440); r = 55; for( i = 10 ;i>=1 ;i--) { moveto(10,r); itoa(i,string,10); outtext(string) ; r+=40; } line(165,440,210,440);
  • 11. line(165,440,165,460); line(210,440,210,460); line(165,460,210,460); setfillstyle(0, getmaxcolor()); char ch[2]; do { moveto(400,140); outtext("ENTER OPTION "); ch[0]=getche(); ch[0] = tolower(ch[0]); if(ch[0]=='p') { outtext("p"); delay(500); bar(getx()-30,gety(),getx()+2,gety()+20); if(size<1) { for(int i = 0 ;i<4 ; i++){ moveto(420,170); outtext("Stack Overflow "); delay(1000); setfillstyle(0, getmaxcolor()); bar(420 ,165 ,630 ,180);
  • 12. delay(500);} } else if( size>1) { size--; top++; push(); bar(290,440,350,479); itoa(top,string,10); outtextxy(308,447,string); }}//end of Nested if else if(ch[0]=='o') { outtext("o"); delay(500); bar(getx()-30,gety(),getx()+10,gety()+20); if(size==10) { for(int i = 0 ;i<4 ; i++){
  • 13. moveto(410,170); outtext("Stack, Underflow "); delay(1000); setfillstyle(0, getmaxcolor()); bar(330 ,165 ,630 ,180); delay(500); } } else { top--; pop(); bar(290,440,350,479); itoa(top,string,10); outtextxy(308,447,string); } } } while(ch[0]!='x'); } void push() { int a=178 , b=425 ;
  • 14. moveto(178,447); itoa(arr[count],string,10); outtext(string); delay(10); bar(170,446,208,455); itoa(arr[count+1],string,10); moveto(178,447); outtext(string); moveto(a,b); while(gety()!=y) { setfillstyle(0, getmaxcolor()); circle(a+6,b+3,12); itoa(arr[count],string,10); outtext(string); delay(10); setfillstyle(0, getmaxcolor()); bar(170 ,gety()-20 ,200 ,gety()+14); moveto(a,b); b--; } setfillstyle(0, getmaxcolor()); circle(a+6,b+3,9);
  • 15. outtext(string); moveto(125,b); for(int j =0 ;j<6 ; j++) { outtext("<<--"); delay(100); setfillstyle(0, getmaxcolor()); bar(getx()-3 ,gety() ,getx() ,gety()+8); delay(100); } delay(100); setfillstyle(0, getmaxcolor()); bar(getx()-48 ,gety() ,getx() ,gety()+8); delay(100); delay(200); while(getx()!=x+60) { setfillstyle(0, getmaxcolor()); circle(a+6,b+3,9); itoa(arr[count],string,10); outtext(string); delay(10); setfillstyle(0, getmaxcolor()); bar(getx()-20 ,gety()-10 ,getx()+70 ,gety()+20);
  • 16. moveto(a,b); a--; } delay(100); moveto(60,gety()); outtext(string); count++; y = y-40; } void pop() { int a=120, b ; y = y + 40 ; b=y ; moveto(120,y); for(int j=0 ;j<6 ; j++) { outtext("®"); delay(100); setfillstyle(0, getmaxcolor()); bar(getx()-3 ,gety() ,getx() ,gety()+8); delay(100); }
  • 17. delay(100); setfillstyle(0, getmaxcolor()); bar(getx()-48 ,gety() ,getx() ,gety()+8); delay(200); moveto(60,gety()); setfillstyle(0, getmaxcolor()); bar(getx()-10 ,gety()-3 ,getx()+20 ,gety()+8); delay(500); while(getx()!=178) { setfillstyle(0, getmaxcolor()); circle(a+6,b+3,12); moveto(a,gety()); itoa(arr[count-1],string,10); outtext(string); delay(10); setfillstyle(0, getmaxcolor()); bar(getx()-25 ,gety()-10 ,getx()+30 ,gety()+20); a++; } delay(500); while(gety()!=430) {
  • 18. setfillstyle(0, getmaxcolor()); circle(a+21,b+3,7); moveto(178,b); itoa(arr[count-1],string,10); outtext(string); delay(10); setfillstyle(0, getmaxcolor()); bar(getx()-30 ,gety()-10 ,getx()+20 ,gety()+9); b++; } delay(10); moveto(178,447); bar(170,446,208,455); count--; moveto(178,447); itoa(arr[count],string,10); outtext(string); size++; }
  • 21.