Page 1 of 1

و الواو أين هو ، الهii ووفيه و به شما است U FULL New X * 0 Create the following methods for the class MyArray Submit Mai

Posted: Sun May 15, 2022 12:16 pm
by answerhappygod
 1
1 (191.47 KiB) Viewed 55 times
و الواو أين هو ، الهii ووفيه و به شما است U FULL New X * 0 Create the following methods for the class MyArray Submit Main.cpp, (others files if you decide to write your code using .cpp and * h) and a ReadMe.pdf file with screen result screenshot of each function. Address all the function calls in the "int main" in same order of of the following provide specific instructions for the user for the inputs. ements nts (ex: Please enter an element to find :) Methods to Implement atings ashboard Virtual Labs • Default Constructor for the class . Constructor with array size (user input the size) • Destructor for the class . Use random function to store values (ex: store 1000 numbers between 1 and 10000 range) • Function to access the size • Display the content of the array (Display contents as a table of 10 columns with contents left aligned) • Function to Add an element at the beginning • Function to Add an element at the end • Function to remove an element at the beginning • Function to Remove an element at the end • Function to Inverse the order of the elements in the array (perform this function after sorting the array) • Function to Return the sum of the elements in the array . Function to Return an array that contains numbers in sorted order (Display contents as a table of 10 columns with contents left aligned) • Function to Return an array that contains the odd numbers only (Display contents as a table of 10 columns with contents left aligned) • Function to Return the index of given element in the sorted array (func1, handle errors as well if item not found) • Function to Return the index of given element in the sorted array (faster than func1 and explain how is it going to be faster than func1) scover teWave es ENG IN Ax 13:26 26-04-2022

cin>>S; 290 getch(); 291 cout<< -Sorted Array----- 292 m.Sort(); 293 m.Display(); 294 cout<<"\n- 295 cout<<"Enter element to search"; 296 297 298 299 //using Linear search 300 cout<<"\nUsing Linear Search Element is at\t:\t"<<m.FindLinear(s); 301 //binary search 302 cout<<"\nUsing Binary Element is at\t\t:\t"<<m. FindBinary(s); 303 304 } input main.cpp:104:8: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null] 104 | arr=NULL; | main.cpp: In member function 'void myArray: : removeEnd ()': main.cpp:111:12: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null] 111 | arr[siz-1)=NULL; | main.cpp: In member function 'int myArray::FindLinear (int)': main.cpp:202:1: warning: control reaches end of non-void function [-Wreturn-type] 202 |} | Random numbers generated between 1 and 10000: 1058 4243 6590 8884 3685 4319 6427 4915 5029 4943 7212 5980 4003 7531 3027 8717 179 851 9392 4506 183 3983 9451 81 6028 6763 8589 7841 7820 2976