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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:30, ashleypere99
Jane’s team is using the v-shaped model for their project. during the high-level design phase of the project, testers perform integration testing. what is the purpose of an integration test plan in the v-model of development? a. checks if the team has gathered all the requirements b. checks how the product interacts with external systems c. checks the flow of data in internal modules d. checks how the product works from the client side
Answers: 1
image
Computers and Technology, 22.06.2019 21:40, tdahna0403
Develop a function to create a document in the mongodb database “city” in the collection “inspections.” be sure it can handle error conditions gracefully. a. input -> argument to function will be set of key/value pairs in the data type acceptable to the mongodb driver insert api call b. return -> true if successful insert else false (require a screenshot)
Answers: 2
image
Computers and Technology, 23.06.2019 04:20, RandomLollipop
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
image
Computers and Technology, 23.06.2019 12:00, trippie4life
3. when you right-click a linked spreadsheet object, what commands do you choose to activate the excel features? a. linked worksheet object > edit b. edit data > edit data c. linked spreadsheet > edit d. object > edit data
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 in other subjects:

Konu
English, 05.08.2020 14:01
Konu
Business, 05.08.2020 14:01
Konu
English, 05.08.2020 14:01