C++ ************Comment code please************ Into two files, p1.h and p1.cpp, create a class called intList with the following members Private members: int *a // A pointer to the array into which the list values will be stored. int capacity; // memorialize the capacity of the list int size; An integer “pop” to record the number of entries in the list Public members: constructor intList(int size) that causes the array to be sized at “size” entries, with a default size of 100 destructor ~intList() that deletes the dynamically allocated array “a” bool insert(int v) – inserts the value v at the beginning of the list; all other entries shift right. Returns true if v was inserted; otherwise, it returns false. bool add(int v) – inserts the value v at the end of the list. Returns true if the value was inserted; otherwise, it returns false. bool insertAt(int v, int index) – inserts the value v at the index “index”; values at that position need to shift right. Returns true if the value is inserted. Returns false if the list was full or if the index was greater than” size”. int find(int v) – returns the first position at which the value v was found; otherwise returns -1. void printIt() – causes the list to be printed, one value per line; for each line, print the index and the value at that index. void clear() – causes the list to be emptied int count() – returns the number of entries in the list bool deleteAt(int index, int &value) – deletes the value at the given index; shifts the entries right of that index to the left. If the index was within the range of the list, it sets “value” to the value of the item deleted and returns true. Otherwise, it does not change “value” and returns false. Note: All member functions that can be declared const should be declared as const. Print a combined listing of only these files, in the following order: p1.h, p1.cpp, and p1Output.txt Create the file p1Output.txt using the following command in your environment: ./p1 > p1Output.txt cat p1Output.txt (this step ensures that you created the file correctly)

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
C++ ************Comment code please************ Into two files, p1.h and p1.cpp, create a class called intList with the following members Private members: int *a // A pointer to the array into which the list values will be stored. int capacity; // memorialize the capacity of the list int size; An integer “pop” to record the number of entries in the list Public members: constructor intList(int size) that causes the array to be sized at “size” entries, with a default size of 100 destructor ~intList() that deletes the dynamically allocated array “a” bool insert(int v) – inserts the value v at the beginning of the list; all other entries shift right. Returns true if v was inserted; otherwise, it returns false. bool add(int v) – inserts the value v at the end of the list. Returns true if the value was inserted; otherwise, it returns false. bool insertAt(int v, int index) – inserts the value v at the index “index”; values at that position need to shift right. Returns true if the value is inserted. Returns false if the list was full or if the index was greater than” size”. int find(int v) – returns the first position at which the value v was found; otherwise returns -1. void printIt() – causes the list to be printed, one value per line; for each line, print the index and the value at that index. void clear() – causes the list to be emptied int count() – returns the number of entries in the list bool deleteAt(int index, int &value) – deletes the value at the given index; shifts the entries right of that index to the left. If the index was within the range of the list, it sets “value” to the value of the item deleted and returns true. Otherwise, it does not change “value” and returns false. Note: All member functions that can be declared const should be declared as const. Print a combined listing of only these files, in the following order: p1.h, p1.cpp, and p1Output.txt Create the file p1Output.txt using the following command in your environment: ./p1 > p1Output.txt cat p1Output.txt (this step ensures that you created the file correctly)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY