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++2019, Write a program that will include 3 arrays of doubles named length, width, and area each with 10 elements.
In main, do the following:
using a random number generator seeded with time, assign values between 10 and 30 to each element of length.
using a random number generator seeded with time, assign values between 5 and 20 to each element of width.
call function calcArea. See details on calcArea below.
Back in main, print a table of values with 3 columns(length, 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 4 parameters being passed into the function: length, width, area(all arrays), and numelements. the arrays for length and width should be constants in the function(so 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[0] should end up with the area of the rectangle with length[0] and width[0])

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!