subject

For this proficiency test you will write a program that works with an array of integers. The file supplied. o contains binary code that can build, and display an array. For this test, you will need to write the following functions in array. cpp, add function prototypes for them to array. h and invoke the functions in main. cpp. - int sumOfArray(int list[], int size) Compute and return the sum of integers in list. - int remove(int list[], int
-void insert(node *& head, int position, int newInt)
insert newInt in a new node at index "position" where index starts with 0. In other words, the head node is position 0, head->next is position 1, etc. If the parameter position is less than or equal to zero, then place the new node at position 0. If position is greater than or equal to the length of the list, then place the new node at the end of the list. Notice that the head parameter is a reference to a pointer. So anything you do to head in insert() will modify the head pointer in main.
The code files will compile and run without modification, so you can see what build and display will do without adding any code. This may help you get started.
The function build() will create a linear linked list that is from 10 to 20 nodes in length.

The files are below.

//list. cpp
#include "list. h"
//put the implementation of your assigned functions here
ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”
//list. h
#ifndef LIST_H
#define LIST_H
#include
#include
#include
struct node
{
int data;
node * next;
};
/* These functions are already written and can be called to test out your code */
void build(node * & head); //supplied. The resulting list will have from 10 to 20 nodes.
void display(node * head); //supplied
void destroy(node * &head); //supplied
/* YOUR TURN! */
//Write your function prototype here:
#endif
ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”
//main. cpp
#include "list. h"
using namespace std;
int main()
{
node * head = NULL;
build(head); // build() and display() are provided by supplied. o.
display(head); // Don't try to write the function definitions for them.
//PLEASE PUT YOUR CODE HERE to call the functions assigned.
display(head);
destroy(head); // destroy() is also provided by supplied. o.
return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:50
Q-1 which of the following can exist as cloud-based it resources? a. physical serverb. virtual serverc. software programd. network device
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
question
Computers and Technology, 24.06.2019 23:30
Adrian has decided to subscribe for a new internet connection. he wants a high speed connection so that he can stream video content smoothly. which access technology would you advise adrian against using?
Answers: 1
You know the right answer?
For this proficiency test you will write a program that works with an array of integers. The file su...
Questions
question
Mathematics, 13.09.2019 03:30
Questions on the website: 13722363