Question: Write the implementation of the removeltemAtIndex() member function. Before removing the item, first check that the index being asked to be removed is valid, for

  1. Write the implementation of the removeltemAtIndex() member function. Before removing the item, first check that the index being asked to be removed is valid, for example that it is not bigger than the size of the listTo remove the item, simply shift down all items above the index by 1 location, thus removing the indicated item and not leaving a hole in the items array. Don't forget to update the number of items after you finish removing the item.

  1. Write the implementation of the isEmpty () member function declared on line 19 of the class. The list is empty if there are no items currently stored in the list.

  1. Write the implementation of the isFulll function declared on line 20 of the class. The list is full when the number of items in the list is equal to the MAX_ITEMS constant declared in the ListType.

  1. Write the implementation of the finditem() member function. This function should search the current list of items and return true if the asked for item is currently in the list, and if the search fails to find the item on the current list.

#include

using namespace std;

1 2 3 4 5 6 7 8 9 10 11 12

class ListType

{

private:

const int MAX TEMS=20;

int numitems ;

string items;

public :

ListType();

ListType( int numItems, string initItems[]);

ListType();

bool isEmpty () const;

bool isFull () const ;

int getNumitems () const;

string getItemAtIndex( int index ) const;

void appendItem ( string newItem );

bool findItem (string searchItem ) const;

void replaceItemAtIndex (int index, string new int]

void removeItemAtIndex( int index);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!