Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code so far is under the sample section. The int main() is complete and it calls the 3 function that already have the prototypes.

image text in transcribed
The code so far is under the sample section. The int main() is complete and it calls the 3 function that already have the prototypes. Please finish the 3 functions completely as they are suppose to be created following the instruction 1-4. Thanks! Please show that it works.
UllU USB pointer arithmetic to navigate them. 4 points for each function you complete. allocate STRATEGY The main function is provided. It will 1. declares a pointervariable (p and an integer variable called n. 2. calls function makearray to dynamically allocate an array assigned to p. of a random size (from 1 to 10 elements). Variable n contains the size of the The function returns a pointer that is assigned to p. 3. calls function fillarray0 that assigns random values between 1 and 10o to each element of the array using array element indexing. 4. calls function display to display all of the data in the array using pointer arithmetic Run your main program several times to demonstrate different sizes and random data. SAMPLE Here are the function prototypes with pre and post condition comments along with maino. Pre: none allocated Post an array of up to 10 elements is dynamically a pointer to that array is returned the size is assigned to reference parameter n int makearray (int& n) Pre: p points to an array of n integers Post: p is filled with random values from 1 to 100 void fillarray (int p, int n) Pre: p is an array of n integers Post: the contents of p have been displayed void display (int p, int n) int main int p, n; srand (time (0) p make array (n) cout "The size of the array is n endl; fillarray (p, n); display (p, n)

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_2

Step: 3

blur-text-image_3

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

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago