Question: Visual Studios C + + 2 0 1 9 , Write a program that will include 3 arrays of doubles named length, width, and area
Visual Studios C Write a program that will include arrays of doubles named length, width, and area each with elements.
In main, do the following:
using a random number generator seeded with time, assign values between and to each element of length.
using a random number generator seeded with time, assign values between and to each element of width.
call function calcArea. See details on calcArea below.
Back in main, print a table of values with columnslength width, and area use zero decimals in each of the three columns. Include a first row to label each column.
Function calcArea should do the following:
should have parameters being passed into the function: length, width, areaall arrays and numelements. the arrays for length and width should be constants in the functionso any changes made in the function to those array are not passed to main The variables names in the function should be different than those in main.
The function should calculate the area of the rectangle with a length of each element and the width of the same element. for example, area should end up with the area of the rectangle with length and width
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
