Question: These arrays are giving me trouble. Write a function called insert that takes the array, a number, a position and the current size of the
These arrays are giving me trouble. Write a function called insert that takes the array, a number, a position and the current size of the array as parameters. Insert the number at the given position.
Write a function called remove that takes the array, a number and the current size of the array, and removes the first instance of the number from the array.
Write a function called sort that takes the array and its current size as parameters and sorts the array in ascending order.
#include
using namespace std;
const int CAPACITY = 100; //declared global constant
void readArray(int a[], int size); void printArray(int a[], int size);
// Insert function void insert(int a[], int number, int position, int size);
Im pretty clueless on this and the information for the main but the output should look like this:
Enter the number of elements you want to enter (Max 100): 5 Enter 5 numbers 2.5 6 -7 10.7 0.8
1. Insert an element 2. Remove an element 3. Print an element 4. Sort the array
3
5. Exit Enter your option: 1 Enter the number: 3.1 Enter the position: 2 Element Inserted.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
