subject
Computers and Technology, 06.04.2021 03:30 34df

At the beginning of the semester, we studied partially filled arrays. This is when the number of elements stored may be less than the maximum number of elements allowed. There are two different ways to keep track of partially filled arrays: 1) use a variable for the numberElements or 2) use a sentinel (terminating} value at the end of elements (remember c-strings?). In the code below, please fill in the details for reading the values into the an array that uses a sentinel value of -1. Complete the showArray function as well. #include
using namespace std;
void showArray(int array[]);
// ToDo: Code showArray function with one array parameter
int main()
{
const int MAX_SIZE=16;
int array[MAX_SIZE]; // store positive values, using -1 to end the values.
cout <<"Enter up to " << MAX_SIZE-1 << " positive whole numbers, use -1 to stop\n";
//To do: Read the int values and save them in the static array variable.
// When the user enters -1 or the array has no more room, leave the loop..
//To do: store -1 at the end of elements in the array
// Show array function
showArray(array);
return 0;
}
// To do: print out for the array
void showArray(int array[])
{
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
To maintain clarity and focus lighting might be needed
Answers: 2
You know the right answer?
At the beginning of the semester, we studied partially filled arrays. This is when the number of ele...
Questions
question
Mathematics, 07.10.2020 02:01
question
Mathematics, 07.10.2020 02:01
question
Chemistry, 07.10.2020 02:01
question
Mathematics, 07.10.2020 02:01
question
Mathematics, 07.10.2020 02:01