// 13b.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include #include #include #include "13b.h" using namespace std; const int SIZE = 10; int main() { float nums[SIZE] = { 3, 5.3, 7, 3.7, 2, 9, 10}; int amt = 7; cout << "The median value in the array is: " << FindMedian(nums, amt); } float FindMedian(float nums[], const int amt) { float sum; sort(nums, nums + amt); if (amt % 2 == 0) { sum = nums[amt / 2 - 1] + nums[amt / 2]; return sum / 2.0; } else { return nums[(int)ceil(amt / 2.0)]; } }