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 11:00
Which action is good business etiquette? a. switching your cell phone off before you enter a meeting b. keeping your cell phone on low volume before you enter a meeting c. setting a pleasant ring tone on your cell phone before you enter a meeting d. setting a standard ringtone on your cell phone before you enter a meeting
Answers: 1
question
Computers and Technology, 22.06.2019 12:20
Usually, when we sniff packets, we are only interested certain types of packets. we can do that by setting filters in sniffing. scapy’s filter use the bpf (berkeley packet filter) syntax; you can find the bpf manual from the internet. set the following filters and demonstrate your sniffer program again (each filter should be set separately): (a) capture only the icmp packet. (b) capture any tcp packet that comes from a particular ip and with a destination port number 23. (c) capture packets comes from or to go to a particular subnet. you can pick any subnet, such as 128.230.0.0/16; you should not pick the subnet that your vm is attached to.
Answers: 3
question
Computers and Technology, 22.06.2019 20:30
In this lab, you complete a prewritten c program that calculates an employee’s productivity bonus and prints the employee’s name and bonus. bonuses are calculated based on an employee’s productivity score as shown below. a productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.
Answers: 3
question
Computers and Technology, 22.06.2019 22:40
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
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
Social Studies, 17.07.2019 00:00
question
Mathematics, 17.07.2019 00:00
Questions on the website: 13722361