Question: C++ (c) Write a for statement to populate an array, double val [NUMCOUNT], for the following case: Use a counter named double count that has
(c) Write a for statement to populate an array, double val [NUMCOUNT], for the following case: Use a counter named double count that has an initial value of 16.2, a final value of 0.4, and a decrement of 0.2 and populate the val[] array with the value of count. What is the size, NUMCOUNT, of the array val? 2+5 points] SOLUTION: we can calculate NUMCOUNT= 1 + abs(final-initial)/increment = 1 + (16.2-0.4)/Q2 = 80 const int NUMCOUNT 80 double count, val [NUMCOUNT] int i = 0; for (count _ 16.2; count >-0.4; count -- 0.2) val [i++count; (d) Write a function named check) that has two parameters and does not return any value. Its prototype is as follows: void check (double grade[], double &average). The first parameter should accept a double-precision data array, grade[, and the second returns the average of the grades by reference. 6 points
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
