Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use c++ This project is to practice pointers, pointer arithmetic, returning a pointer from a function and using and & correctly, and the keyword

please use c++ image text in transcribed

image text in transcribed

This project is to practice pointers, pointer arithmetic, returning a pointer from a function and using and & correctly, and the keyword now. This project is also to practice meeting the requirements as stated and review how to use arrays, how to pass an array to or from a function. Description RI: Create an array of integers by defining the following function that returns the array. The size of the array is set from the user input doublet create_array(int* size); * R2: Fill the array using random integers in the range interval [10, 30) void fill_array(double' a, int size); R3: display the array by defining the following function void print_array(double*a, int size); R4: Compute the average value of the data and display it double average(double a, int size); /Exercises P75 in the textbook In this function, use pointer Tariable, and not an integer index, to traverse the array . elements . R5: Find the memory (RAM) address that store: the maximum value among the data element and display it double maximum(double all, int size); Exercises P7:6 in the textbook In this function, check the size of the array. If it is 0, returu NULL or nullptr. Otherwise, return the address where the maximum value it found. . R61 Reverse the values of the array by traversing the anay elements using two pointer variables, and not integer indexes void reverse(double a[], int size); 1. Outputs Below are the sample outputs with the array size of 5 and 6, respectively. Replace each screenshot below with your own. . Size 5 [08/17/20) seed client:10.0.2.13 1./eepointers$ a. out Enter an array size: 5 After initializing 13.0000 @x98df298 16.0000 0x93df2a0 27.0000 0x98df2a8 25.0000 0x98df2b0 23.0000 Bx98df2b8 avecage = 28.8800 max position - 0x98df2a8 After reversing : 23.0000 0x98df298 25.0000 9x98df2a0 27.0000 8x98df2a8 16.0000 0x98df2be 13.0000 Ox98df2b8 b. Size 6 [08/17/20) seed@client:10.0.2.13 -/.../obpointerss a.out Enter an array size: 6 After initializing 13.0000 Bx8393298 16.0000 Bx839320 27.0000 BX8393208 25.0000 Ox83932b0 23.0000 Bx8393258 25.0000 GX83932c average - 21.5090 max position - Ox83932a8 After reversing 25.0000 Bx8393298 23.9000 Bx83932a 25.0000 Ox8393298 27.0000 Ox8393250 16.0000 Bx8393258 13.0000 Ox83932c

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

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

3. Who would the members be?

Answered: 1 week ago

Question

4. Who would lead the group?

Answered: 1 week ago