Instruction: We will write a program that prompts the user to enter a sequence of positive integers (ending with -1), reports the smallest value among these integers, and then displays these integers and their difference from the smallest value. Please name your source code as lab8.cpp.
Your program works as follows. Note that you are not required to design and implement functions in this lab, you can write all the codes in the main():
An example run of your program is as follows, where the user inputs are underlined, and the program output are shown in regular format:
$ ./a.out Please enter up to 50 positive integers, ending with -1:32 30 12 3 100 29 1 42 80 90 -1 The smallest value is 1. The largest value is 100. All values and their difference from smallest and largest values are: 32 31 68 30 29 70 12 11 88 3 2 97 100 99 0 29 28 71 1 0 99 42 41 58 80 79 20 90 89 10Structure Requirement:
Please write the following functions for this lab. You can introduce more functions, but minimally, you need to practice writing the following two functions, and call them in main.
//array data has been filled with size # of values // the array is used from index 0...size-1 // return the smallest value among these int Smallest (int data[], int size);
//array data has been filled with size # of values // the array is used from index 0...size-1 // return the largest value among these int Largest (int data[], int size);
How to submit
Please submit your program (which has to be named lab8.cpp) to the following webpage: