Question: Need help solving this program The objective is this lab is for you to maripulate arays and pointers to arrays in C The problem: For
The objective is this lab is for you to maripulate arays and pointers to arrays in C The problem: For his lab, you need to develop a Enter the nunber of integers you want to irput (at least 2): C++ program tat prompts the for a number of integers, and then Enter 7 integers plays wih that array, along with pointer to that array and a copy that arr ay. C The tollowing could be a LUL run of your program Here are the nunbers entered in sone array: 11 3 24 17 20 12 15 The sane nunbers through a pointer to the array: 11 3 24 17 20 12 S The sane nunbers held in the copy of the array: 11 3 24 17 20 12 15 After sorting the array in ascending order ller. ar* tho nunberattered i acte array: 3 10 11 12 15 17 24 As part of your program, you mplement the following w The sane nunbers through a pointer tote aEay functions to hande a given array of The numbeza held in the copy of thearray aiven size After sorting the eopy in ascending order Heze are the numbers tered is sone aEEy The sae nunbers through a pointer to the array The sane nunbers held in the eopy of the ary duplicatekrEay functiom accepts an array of integer that indicates the // The function return8 m0? if th. 8ize is invalid, etherwis t creates an array that is the duplicate of the given array and returns a pointer to the new array int duplicaterray (const intint / The displayArray function accepts an array of integers // The function displays the contents of the array and an integer that indicates the size of the array void displayArray (oonst intant) Your program should make use of an array of integers, called myArray, of a size determined atter the user entered the number of integers that wil be collected. The number of inegers should be at least 2 to be able to make visble O changes to the anray Once the input is complete, your program should declare a pointer to mykrray. called nyointer. Your program should declare another pointer, myCopy that il receive the duplicabe of myarzay (through a call to the duplicatekzray function). Your program should dsplay all 3 "versions" of nyarray, by caling the displayarray function 3 tmes with then with myPointer, and then with nyCopy Next yourprogram should sort te negers in myArray in ascening order, and should, agan dsplay the 3 versions of ayAreay Finally your program should sot the integers in nyCopy in descending order, and it shouild, again display the 3 O versions of myArray. What to hand in: Submit your .cpp le through Sakai. Lab #8-Arrays and Pointers to Arrays
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
