Introduction
:
#include
using namespace std;
int Array=NULL;
int head;
int count;
int testData;
int Size=5;
int exit()
{
cout<<”…exit”<
Requirement
Array based FIFO
Write a program that implements an array based Queue. UDFs should be used extensively.
Main should only contain calls to UDFs. Variables used may be declared globally.
These are the UDFs that you should include: This is very similar to Push and Pop.
int exit();
void enter(int t);
void display();
void isfull();
void isempty();
void initialize();
Here is my main:
int main()
{
int l;
initialize();
display();
enter(1);
display();
isfull();
enter(2);
display();
enter(7);
display();
enter(9);
display();
isempty();
enter(13);
display();
exit();
display();
enter(42);
display();
exit();
display();
enter(25);
display();
enter(19);
display();
isfull();
return 0;
}
The numbers I tried to insert are:
1 2 7 9 13 42 25 19
My maxsize was 5.
Here is my output. My output shows the calls to UDFs. Do this also. Your output
should duplicate this.