-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueueswiggy.cpp
40 lines (36 loc) · 959 Bytes
/
queueswiggy.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include<iostream>
#include<stdlib.h>
using namespace std;
struct Node{
int item_code;
struct Node* next;
};
class SwiggyQueue{
private:
struct Node* head;
public:
SwiggyQueue(){
head=NULL;
}
void newOrder(int item_code){
struct Node* temp=(struct Node*)malloc(sizeof(struct Node));
temp->item_code=item_code;
temp->next=head;
head=temp;
}
void showAllOrders(){
cout<<"\nAll Pending orders In Queue"<<endl;
struct Node* temp=head;
while(temp){
cout<<"Item Code:"<<temp->item_code<<endl;
temp=temp->next;
}
}
void currentlyPreparingOrder(){
struct Node* temp=head;
while(temp->next){
temp=temp->next;
}
cout<<"\nCurrently Preparing: "<<temp->item_code<<endl;
}
};