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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 08:30, Calirose
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
image
Computers and Technology, 23.06.2019 13:00, jaelynnm
Donnie does not have powerpoint. which method would be best for elana to save and share her presentation as is? a pdf a doc an rtf a ppt
Answers: 3
image
Computers and Technology, 23.06.2019 18:50, ana7496
What is transmission control protocol/internet protocol (tcp/ip)? software that prevents direct communication between a sending and receiving computer and is used to monitor packets for security reasons a standard that specifies the format of data as well as the rules to be followed during transmission a simple network protocol that allows the transfer of files between two computers on the internet a standard internet protocol that provides the technical foundation for the public internet as well as for large numbers of private networks
Answers: 2
image
Computers and Technology, 24.06.2019 00:50, JakeCline
Which of the following is not a key player in the sale of travel products?
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 in other subjects:

Konu
Mathematics, 16.12.2020 23:40