What does the following program print out? There are no actual number, so in wha
ID: 3540172 • Letter: W
Question
What does the following program print out? There are no actual number, so in what is being computed?
int bry[200], size sumNbr, count;
int *p;
...assume more code here to fill array with values. Number of values in array is ' size '
sumNbr = SumIt(bry, size, average); //program you wrote earlier on this test
p = bry; count = size;
for ( i = 0; i < size; i++)
{ if ( *p < average)
{ count = count -1;
p = p +1;
}
}
cout << " count: " << count << endl;
What is the statement ' int *p ' defining? Be specific.
What does the ' *p ' mean in the statement if ( *p < average )? ( Less than average is not the answer)
What is happening in the statement 'p = p + 1' ? Be specific.
Given the following sorted data, show the values of low, high, and mid to find the value 16. Show all work.
0 1 2 3 4 5 6 7 8 9 <--- subscripts to the array
1 2 7 8 12 13 16 19 21 24 <--- values in the array
What happens to low and high values if we looked up the value of 15 in the above list?
Explanation / Answer
this is the program which will take a list of numbers and find the mid number.
What is the statement ' int *p ' defining? Be specific.
it is the initializing or defining of the pointer of p. which is *p
What does the ' *p ' mean in the statement if ( *p < average )?
this instruction will check if the pointer of p is less than the average integer
it will be true if the array will be having less than the half digits in memory....but i don't seen any definition of integer "average"...!
What is happening in the statement 'p = p + 1' ? Be specific.
this will move the pointer of p to next level or to next number.
Given the following sorted data, show the values of low, high, and mid to find the value 16. Show all work.
0 1 2 3 4 5 6 7 8 9 <--- subscripts to the array
1 2 7 8 12 13 16 19 21 24 <--- values in the array
low=>> 1 2 7 8
mid=>> 16
high=>> 19 21 24
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.