Question: Plz type uor answer. (a) An array named heights that consists of 10 components of the type double is passed to a function named sum.

Plz type uor answer.

Plz type uor answer. (a) An array named heights that consists of

(a) An array named heights that consists of 10 components of the type double is passed to a function named sum. Function sum takes as its arguments the following: (1) an array of floating point values; (2) an integer indicating the size of the array. This function returns the sum of the floating point values in the array. Given that array heights has the following values: 5. 2, 6.3, 5.8, 4.9, 5.2, 5.7, d.7, 7.1, 5.10, 6.0. Show in C++ statements the complete program that calculate the sum of array heights. [15/00] b) Suppose that overspeed and fine are double variables. Show C++ statements using an apropriate control structure that assigns a value to fine as follows: if 0 15, the fine is $150.00 plus $20.00 per each overspeed mile. [5/100]

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 Programming Questions!