Instruction: 1) Do not change the name of class. 2) Should write each line comments to explain your code. 3) Follow the guidelines we discussed in our class in submitting programming assignment when you submit via Bb. 4) We learned the arrayListType class in our classroom . You need to add/modify the member functions, removeAt(), removeALL(), max(), to the class arrayListType. 1. Write the definition of the implement ion of the three functions in the attached file. (A) The function removeAt of the class arrayListType removes an element from the list by shifting the elements of the list. However, if the element to be removed is at the beginning of the list and the list is fairly large, it could take a lot of computer time. Because the list elements are in no particular order, you could simply remove the element by swapping the last element of the list with the item to be removed and reducing the length of the list. Rewrite the definition of the function removeAt using this technique. Use the following function. declaration. void removeAt(int location); (B) The function remove of the class arrayListType removes only the first occurrence of an element. Add the function removeAll to the class arrayListType that would remove all occurrences of a given element. Also, write the definition of the function removeAll and a program to test this function. Use the following function declaration. void removeAll(const elemType& removeItem); (C) Add the function max to the class arrayListType to return the largest element of the list. Also, write the definition of the function max and a program to test this function. Use the following function declaration. elemType max() const; 2. Write a test program to perform the followings (see the output) (A) Create a default list (B) Insert six elements into the list. You need to prompt the user to get the elements. (C) Print the list (D) You need to prompt the user to have the position of element to be deleted. Then display the list after removing the element (E) You need to prompt the user to delete all occurrence elements to be deleted. Then display the list after removing them (F) Print a maximum value of the list after all tasks give to the above are complete.

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

Instruction: 1) Do not change the name of class. 2) Should write each line comments to explain your code. 3) Follow the guidelines we discussed in our class in submitting programming assignment when you submit via Bb. 4) We learned the arrayListType class in our classroom

. You need to add/modify the member functions, removeAt(), removeALL(), max(), to the class arrayListType.

1. Write the definition of the implement ion of the three functions in the attached file.

(A) The function removeAt of the class arrayListType removes an element from the list by shifting the elements of the list. However, if the element to be removed is at the beginning of the list and the list is fairly large, it could take a lot of computer time. Because the list elements are in no particular order, you could simply remove the element by swapping the last element of the list with the item to be removed and reducing the length of the list. Rewrite the definition of the function removeAt using this technique. Use the following function. declaration. void removeAt(int location);

(B) The function remove of the class arrayListType removes only the first occurrence of an element. Add the function removeAll to the class arrayListType that would remove all occurrences of a given element. Also, write the definition of the function removeAll and a program to test this function. Use the following function declaration. void removeAll(const elemType& removeItem);

(C) Add the function max to the class arrayListType to return the largest element of the list. Also, write the definition of the function max and a program to test this function. Use the following function declaration. elemType max() const;

2. Write a test program to perform the followings (see the output) (A) Create a default list

(B) Insert six elements into the list. You need to prompt the user to get the elements.

(C) Print the list

(D) You need to prompt the user to have the position of element to be deleted. Then display the list after removing the element

(E) You need to prompt the user to delete all occurrence elements to be deleted. Then display the list after removing them

(F) Print a maximum value of the list after all tasks give to the above are complete.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 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