Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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++ image text in transcribed
(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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago