subject

You will create an array manipulation program that allows the user to do pretty much whatever they want to an array. Present the user with a menu, detect their choice, and provide them any needed follow up prompts that are needed.
When the program begins, you will prompt the user for an initial size of the array, then the values to fill the array. Your array will contain ints. For example, the user could say they want an array of size 5, then you prompt for the 5 values to put in the array.
After the initial array is filled, interact with the user via a menu until they want to quit.
Sample Menu
Make a selection:
1) Insert
2) Remove
3) Count
4) Print
5) Exit
Choice:
Additional Requirements
For each of the options the user has access to, create a function to handle the work involved.
int* insert(int arr[], int size, int value, int position)
Inserts the given value at the specified position
Creates a new array, copies all old value over adjusting indices as necessary
Returns a pointer to the new array
int* remove(int arr[], int size, int position)
Reomves the value at the given position
Creates a new array, copies all old value over adjusting indices as necessary
Returns a pointer to the new array
void print(int arr[], int size)
Prints array as required
OptionDescription
Insert
The user will provide a position to insert a value
You must obtain a valid position before moving on
Obtain the value to insert and insert it into the array
NOTE: The array will be one element larger after
Remove
The user will provide a position to remove a value
You must obtain a valid position before moving on
Once you have a valid position, remove that value
NOTE: The array will be one element smaller after
Count
Obtain a value from the user
Tell them how many times that value is in the array
Print
Print the contents of the array in the following format:
[1, 3, 99]
Exit
Exits the program

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:50
17. implement the jvm dload instruction for the mic-2. it has a 1-byte index and pushes the local variable at this position onto the stack. then it pushes the next higher word onto the stack as well
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
Alex’s family members live in different parts of the world. they would like to discuss the wedding plans of one of their distant relatives. however, alex wants all the family members to talk to each other simultaneously so that they can make decisions quickly. which mode of internet communication should they use? a. blog b. email c. wiki d. message board e. instant messaging
Answers: 2
question
Computers and Technology, 24.06.2019 09:50
Create a string list. 2. use console.readline() to collect values of firstname, lastname, street, city, state, zip, save them to list. 3. write a simple linq statement, call method uppercasewords() to change first letter to uppercase. 4. create a foreach statment to display the information. public static string uppercasewords(string value) { char[] array = value.tochararray(); if (array.length > = 1) { if (char.islower(array[0])) { array[0] = char.toupper(array[0]); } } for (int i = 1; i < array.length; i++) { if (array[i - 1] == ' ') { if (char.islower(array[i])) { array[i] = char.toupper(array[i]); } } } return new string(array);
Answers: 3
question
Computers and Technology, 24.06.2019 13:00
If you add the following to the query grid in an access query, what is it called? salestaxamt: [salestaxrate]*[totalsale] formula calculated field total calculation
Answers: 2
You know the right answer?
You will create an array manipulation program that allows the user to do pretty much whatever they w...
Questions
question
Mathematics, 23.04.2021 20:50
Questions on the website: 13722360