Question: Please answer Q3 and Q4 Reference for part b 3. In one or two sentences, explain why the value printed by the program in response

 Please answer Q3 and Q4 Reference for part b 3. In

Please answer Q3 and Q4

Reference for part b

one or two sentences, explain why the value printed by the program

3. In one or two sentences, explain why the value printed by the program in response to the samples given in part (b) does not match the value that a human might expect. Use line numbers for specificity. 4. In one or two sentences, suggest a change to the program to make the calculation of the average more accurate. average.c #include 1 2 3 4 5 int main() { int i; int sample; int average = 0; 6 7 9 10 11 12 13 for (i = 1; 10 >= i; i = i + 1) { /* Read a sample. */ printf ("Enter sample #%d: ", i); if (1 != scanf ("%d", &sample)) { printf ("Numeric samples only! "); /* Quit indicating failure (anything non-zero, * by convention). return 3; } 14 15 */ 16 17 18 19 /* Process the next sample. */ average = average + (sample / 10); 20 21 } 22 23 /* Print the results. */ printf ("The average is %d. ", average); 24 25 26 27 /* Program has finished successfully, * * so return by convention. */ return; 28 29 } Enter sample #1: 19 Enter sample #2: 19 Enter sample #3: 19 Enter sample #4: 19 Enter sample #5: 19 Enter sample #6: 19 Enter sample #7: 19 Enter sample #8: 19 Enter sample #9: 19 Enter sample #10: 19 The average is 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!