Add the code of the ArrayListType to your code. Part 2: Create an Ordered_List class derived from the ArrayListType then add the following function to this class: • Constructor to create an array of the size specified by the parameter size. The default array size is 20. • Sorted Insert this function takes an integer values then add it to the list this function should check whether the value exist in the list or not. If it is already exist then it will not be inserted to the list, this function should keep the list ordered. • Remove function to remove an item from the list. The function takes a single parameter that specifie

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
Part 1:
Add the code of the ArrayListType to your code.
Part 2:
Create an Ordered_List class derived from the ArrayListType then add the following function to this class:
Constructor to create an array of the size specified by the parameter size. The default array size
is 20.
Sorted Insert this function takes an integer values then add it to the list this function should
check whether the value exist in the list or not. If it is already exist then it will not be inserted to
the list, this function should keep the list ordered.
Remove function to remove an item from the list. The function takes a single parameter that specifies
the number to be removed.
• Sequential Search a function to search the list for an integer if exist return its location otherwise
return -1. This function specifies the number we are looking for as a parameter.
Part 3:
Implement the following non-member functions to deal with the Ordered List objects:
Load file: this function should read a text file consist an integer numbers then add them to the object
passed as argument to the function. Use the following prototype
void Load File (Ordered List &list1):
Store data: this function should store the list from an object of Ordered List class to a new text file.
Use the following prototype
void Store_Data (Ordered_List list1);
Duplicate this function should multiply each number in the list by 2 and update the list with the new
values. Use the following prototype
void Duplicate (Ordered_List &list1);
Remove this function should take an integer number as a parameter and delete all its multiples from
the list.Use the following prototype
void Remove (Ordered_List &list1 , int val);
Separate this function should separate the numbers from an object to a tow new lists one for ODD
numbers and one for EVEN numbers. Use the following prototype
void Separate (Ordered_List list1, Ordered_List &ODD, Ordered_List &EVEN)
Part 4:
Write a menu driven program that allow the user to perform the flowing options:
1) Load file
2) Add new number
3) Duplicate numbers
4) Remove multiples of 3
5) Separate odd and even
6) Store list
7) Exit
Transcribed Image Text:Part 1: Add the code of the ArrayListType to your code. Part 2: Create an Ordered_List class derived from the ArrayListType then add the following function to this class: Constructor to create an array of the size specified by the parameter size. The default array size is 20. Sorted Insert this function takes an integer values then add it to the list this function should check whether the value exist in the list or not. If it is already exist then it will not be inserted to the list, this function should keep the list ordered. Remove function to remove an item from the list. The function takes a single parameter that specifies the number to be removed. • Sequential Search a function to search the list for an integer if exist return its location otherwise return -1. This function specifies the number we are looking for as a parameter. Part 3: Implement the following non-member functions to deal with the Ordered List objects: Load file: this function should read a text file consist an integer numbers then add them to the object passed as argument to the function. Use the following prototype void Load File (Ordered List &list1): Store data: this function should store the list from an object of Ordered List class to a new text file. Use the following prototype void Store_Data (Ordered_List list1); Duplicate this function should multiply each number in the list by 2 and update the list with the new values. Use the following prototype void Duplicate (Ordered_List &list1); Remove this function should take an integer number as a parameter and delete all its multiples from the list.Use the following prototype void Remove (Ordered_List &list1 , int val); Separate this function should separate the numbers from an object to a tow new lists one for ODD numbers and one for EVEN numbers. Use the following prototype void Separate (Ordered_List list1, Ordered_List &ODD, Ordered_List &EVEN) Part 4: Write a menu driven program that allow the user to perform the flowing options: 1) Load file 2) Add new number 3) Duplicate numbers 4) Remove multiples of 3 5) Separate odd and even 6) Store list 7) Exit
Expert Solution
steps

Step by step

Solved in 2 steps

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