Q1:, ., Implement a range function for a dynamic array which returns a new dynamic array that is a subset of the original. input parameters: array - (the array and any related parameters) start - index of the first element end - index of the last element Interval - An integer number specifying the incrementation of index This function returns a new dynamic array containing the elements from the start thru the end indices of the original array. All array indexing must be done using pointer arithmetic. For example, given the array: 49 96 99 47 76 29 22 16 30 22 If the start and end positions were 5 and 9 with step 2, return a new dynamic array: 29 16 22 Please use following main to test your function. int main(){ int *p = new int[10]{49,96,99,47,76,29,22,16,30,22}; int *q = range(p,10,5,9,2); for(int i=0;i<3;i++) cout<
Q1:, ., Implement a range function for a dynamic array which returns a new dynamic array that is a subset of the original. input parameters: array - (the array and any related parameters) start - index of the first element end - index of the last element Interval - An integer number specifying the incrementation of index This function returns a new dynamic array containing the elements from the start thru the end indices of the original array. All array indexing must be done using pointer arithmetic. For example, given the array: 49 96 99 47 76 29 22 16 30 22 If the start and end positions were 5 and 9 with step 2, return a new dynamic array: 29 16 22 Please use following main to test your function. int main(){ int *p = new int[10]{49,96,99,47,76,29,22,16,30,22}; int *q = range(p,10,5,9,2); for(int i=0;i<3;i++) cout<
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...
Related questions
Question
help with c++...paste indented code plzz
![Q1:, ., Implement a range function for a dynamic array which returns a new
dynamic array that is a subset of the original.
input parameters: array - (the array and any related parameters)
start - index of the first element
end - index of the last element
Interval - An integer number specifying the incrementation of index
This function returns a new dynamic array containing the elements from the start thru
the end indices of the original array.
All array indexing must be done using pointer arithmetic.
For example, given the array:
49 96 99 47 76 29 22 16 30 22
If the start and end positions were 5 and 9 with step 2, return a new dynamic array:
29 16 22
Please use following main to test your function.
int main(){
int *p = new int[10]{49,96,99,47,76,29,22,16,30,22};
int *q = range(p,10,5,9,2);
for(int i=0;i<3;i++)
cout<<q[i]<<" "; // print 29 16 22
cout<<endl;
delete [] q;
q = range(p,10,1,8,3);
for(int i=0;i<3;i++)
cout<<q[i]<<" "; // print 96 76 16
cout<<endl;
delete [] q;
}
%3D
%3D](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe0c0eda2-521b-4eab-8782-362c8a1f5d1a%2F8134323b-d482-4454-9466-9f26026d2af8%2F9l5dzrd_processed.png&w=3840&q=75)
Transcribed Image Text:Q1:, ., Implement a range function for a dynamic array which returns a new
dynamic array that is a subset of the original.
input parameters: array - (the array and any related parameters)
start - index of the first element
end - index of the last element
Interval - An integer number specifying the incrementation of index
This function returns a new dynamic array containing the elements from the start thru
the end indices of the original array.
All array indexing must be done using pointer arithmetic.
For example, given the array:
49 96 99 47 76 29 22 16 30 22
If the start and end positions were 5 and 9 with step 2, return a new dynamic array:
29 16 22
Please use following main to test your function.
int main(){
int *p = new int[10]{49,96,99,47,76,29,22,16,30,22};
int *q = range(p,10,5,9,2);
for(int i=0;i<3;i++)
cout<<q[i]<<" "; // print 29 16 22
cout<<endl;
delete [] q;
q = range(p,10,1,8,3);
for(int i=0;i<3;i++)
cout<<q[i]<<" "; // print 96 76 16
cout<<endl;
delete [] q;
}
%3D
%3D
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 4 images

Recommended textbooks for you

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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

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
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY