Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please code in C++!! 1) Write a function that takes as input parameters (using call by pointer) 3 integers. It generates a random number between

Please code in C++!!

1) Write a function that takes as input parameters (using call by pointer) 3 integers. It generates a random number between 25 and 50 (not including 50). It then creates an array on the memory heap of that length. It generates a random high number (mine was between 5 and 10) and a random low number (between -5 and -10) and fills in the array iteratively with random numbers between the high and the low numbers*, and it returns that array. The input parameters should be modified so that it holds the length of the array, the high value, and the low value.

*not including the high in general when we specify a range, we include the first value but not the last. If I forget to say that in the future, you can assume thats what I intended.

2) Make a second version of the above function, only in this case, instead of using a for or a while loop, it calls a recursive function to fill in the array with random numbers between the high and the low as defined above (so this function works exactly the same as the above function in terms of input and output. However, for the loop that fills the array, it calls a recursive function that you must write to fill in the random numbers).

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

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions