Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ Instructions Download the files minFinding.cpp and FindMin.h At the moment m

ID: 3757571 • Letter: C

Question

C++

Instructions Download the files minFinding.cpp and FindMin.h At the moment minFind.cpp does not compile because it needs a proper definition of the findMin function, which you are required to provide in the FindMin.h file When you are done implementing this function, you should upload your FindMin.h file Before uploading, you should make sure your code is running correctly by testing it on different inputs. The input required by this program is as follows: The first line of input is an integer, call it N, which specifies the size of the list we will be searching through The next N lines of input represent the list of numbers that we are taking in The next two lines are two integers, X and Y, which specify the beginning and the end of the range in which the function should search for the minimum Your findMin furnction should find the smallest integer in the range starting from X, up to but not including Y The sample input given here states that we have 5 numbers in our list. They are 1, 3, 5, 4, 2. The range of indices we should search through is from 1, up to but not including 4. The numbers we are actually searching through are therefore 3, 5, 4, because 3 is in position 1, and 4 is in position 3 (remenber up to but not including position 4) The desired result is therefore 3 Sample Input Sample Output Smallest number in range -4): 3

Explanation / Answer

#include<climits>

int findMin(int *numbers , int p, int r)

{

    // store the index of minimum element

    int index = -1;

   

    // store the minimum element

    int min_element = INT_MAX:

   

    int i;

   

    for( i = p ; i < r ; i++ )

    {

        // if current element is smaller than min_element

        if( numbers[i] < min_element )

        {

            min_element = numbers[i];

            index i;

        }

    }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote