Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am not sure how to do this please help me guys this is for C++ Thanks [Part 1: C Array example] Create two overloaded

I am not sure how to do this please help me guys this is for C++ Thanks

[Part 1: C Array example]

Create two overloaded methods that return the average of an array with the following prototypes:

int average(const int[] , int ); double average(const double[] , int);

Write a driver program that randomly generates ten integers between 0 100, and ten double values with 2 decimal digits between 0 50. (Use srand and rand to get array element values. )

You may add the following functions to generate random numbers:

void intArrayGenerator(int[], int size, int low, int high); void doubleArrayGenerator(double[], int size, int low, int high);

Invokes both functions, and displays all values and the average values. (All double numbers will be displayed with two-digit decimal places.) Each line displayed each element from both arrays.

[Part 2: Using C++ Array]

Peer Discussion:

The function prototypes provided are for C Array, how will you modify them for C++ Array? Rewrite all functions with C++ array and test all of them.image text in transcribed

> Index Int Array Double Array ======================================== 37.36 23.16 38.93 34.03 31.26 11.08 1.69 39.01 24.91 11.90 ======================================== Average 44 25.33 46 98 > Index Int Array Double Array ======================================== 7.88 44.59 36.51 46.35 35.32 46.45 9.69 17.70 20.29 29 39.43 ======================================== Average 51 30.42 + 0 20

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

Students also viewed these Databases questions