subject

Remember partially filled arrays where the number of elements stored in the array can be less than its capacity (the maximum number of elements allowed). We studied two different ways to represent partially filled arrays: 1) using an int variable for the numElems and 2) using a terminating value to indicate the end of elements called the sentinel value. In the code below, please fill in the details for reading values into the latter type of array that uses a sentilnel value. Don't forget to complete the printArray function. #include
using namespace std;
void printArray(int array[]);
// Implement printArray as defined with one array parameter
int main()
{
const int CAPACITY=21;
int array[CAPACITY]; // store positive/negative int values, using 0 to indicate the end of partially filled array
cout <<"Enter up to " << CAPACITY-1 << " non-zero integers, enter 0 to end when you are done\n";
//To do: Write a loop to read up the int values and store them into array a.
// Stop reading if the user enters 0 or the array a is full.
//To do: store 0 to indicate the end of values in the array
//Display array function
printArray(array);
return 0;
}
// To do: implement display for the given array
void printArray(int array[])
{
}

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 20:00, ayoismeisalex
When you mouse over and click to add a search term this(these) boolean operator(s) is(are) not implied. (select all that apply)?
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, kimhoss2
What are ways to switch windows in excel? check all that apply. on the status bar, click the windows button, and then click the file name. on the task bar, click to display the excel jump list, and then click the file name. on the view tab, in the window group, click switch windows, and then click the file name. on the review tab, in the viewing group, click files, and then click the file name.
Answers: 1
image
Computers and Technology, 23.06.2019 21:30, quintonps12
Which of the following includes the three primary network access technologies? dsl, cable modem, broadband lan, wan, man voip, uc, iptv tcp/ip, ftp, dhcp
Answers: 2
image
Computers and Technology, 24.06.2019 01:00, summerjoiner
Verify each identity[tex] \frac{csc}{cot \: x \: + \: tan \: x} = cos \: x[/tex]
Answers: 1
You know the right answer?
Remember partially filled arrays where the number of elements stored in the array can be less than i...

Questions in other subjects:

Konu
Mathematics, 20.09.2019 01:30
Konu
Mathematics, 20.09.2019 01:30