Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

//Driver program for Part 1: Array Based List #include using namespace std; void Insert(int data[], int item, int& length); bool isEmpty(int[], int size); bool isPresent(int

image text in transcribed

//Driver program for Part 1: Array Based List #include using namespace std;

void Insert(int data[], int item, int& length); bool isEmpty(int[], int size); bool isPresent(int data[], int item, int length); void Delete(int data[], int item, int& length); void printList(int data[], int length);

const int MAX_LENGTH = 10;

int main() { int a[MAX_LENGTH], size = 4;

cout

printList(a, size); cout

cout

printList(a, size);

cout

printList(a, size);

cout

printList(a, size);

system("pause"); return 0; }

void Insert(int data[], int item, int& length) { }

bool isEmpty(int[], int size) { return false; }

bool isPresent(int data[], int item, int length) { return true; }

void Delete(int data[], int item, int& length) { }

void printList(int data[], int length) { }

image text in transcribed

The first part is what the problem is and what the proper output looks like. The second part is my source code and what I am currently getting as a printout.

List Part 1: Array Based List (Unsorted) Create a program named arrayList.cpp. In that program, add the following functions. You should use the driver program in the D2L drive. void Insert(int data[], int item, int& length); bool isEmpty(int[], int size); bool is present(int data[], int item, int length); void Delete(int data[], int item, int &length); void pcinthist(int data[], int length); Sample Run: 1. Insert 15, 39, -90, 64 into a list. Now, 15, 39, -98, 64, are in the list. 2. The current lenght of the list is 4 3. Check whether 39 is in the list. The number is in the list. Delete 39 Now, 15, 64, -90, are in the list. De lete -90. 15, 64 sequentially The list is empty. Press any key to continue Snipping Tool 1. Insert 15, 39, -90, 64 into a list. 2. The current lenght of the list is 4 3. Check whether 39 is in the list. The number is in the list. Delete 39. Delete -90, 15, 64 sequentially Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions