Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

So I'm currently working on a median value program and I'm having difficulty with it. Below is the scratch work but I'm having difficulty because

So I'm currently working on a median value program and I'm having difficulty with it. Below is the scratch work but I'm having difficulty because it requires to use pointer notation. I'm getting many errors on Visual Studio. Any help would be greatly appreciated! image text in transcribed

#include

using namespace std;

int getMedian(double*a[], int);

int getMedian(double*a[], int)

{

int midIndex = 0;

double median = 0;

int i;

if ((i % 2) != 0)

{

midIndex = ((i % 2));

&median = a[midIndex];

return median;

}

else

{

midIndex = i / 2;

median = ((a[midIndex] + a[midIndex + 1]) / 2);

return median;

}

}

int main()

{

int number;

double *array;

int median = 0;

cout

cin >> number;

cout

array = new int[number];

median = getMedian(*a[], number);

cout

cout

cin >> number;

cout

median = getMedian(*a[], number);

cout

}

cCWindows'system32\cmd.exe The values of array one are 1 3 The median of array one is 3 The values of array two are 2 4 5 9 The nedian of array two is 4.5 Press any key to continue

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

Oracle Databases On The Web Learn To Create Web Pages That Interface With Database Engines

Authors: Robert Papaj, Donald Burleson

11th Edition

1576100995, 978-1576100998

More Books

Students also viewed these Databases questions

Question

=+2 Why are international employment standards important to IHRM?

Answered: 1 week ago

Question

=+1 Why are local employment laws important to IHRM?

Answered: 1 week ago

Question

=+ Are some laws more important than others? If so, which ones?

Answered: 1 week ago