Question: in c++, please include Pseudocode (explenation of steps at the top of the program) also explanation for each step. Thank you so much in advance
White a program to sort the elements. in array using selection sort algonithm. Your selection sort aigorithm should be a function as a beiow. void SelectionSort (int [], int numRecords): You should get the elements of the array from the user. Lets assume the size of the array is 10. The number of elements should not be greater than the size of the array, Do an Input validation check here. Call the selection sort function with the populated array Finaliy display the sorted elements. Here is a sample run. (Keep prompting the user unti the number of elements is less than 11 How many elenents? 15 The number of elements should be 1 sas than 11 or qreater than 0 How many elements? 4 Enter the elements: 12452314 The sorted array 18:12142345 main.cpp Losid defaut tenpline. 1) minclude ciostream 2. using nanespoce std; wefine stze 10 5 void selectionsort (int [ [\} , int size ) i int sin() I/ Oeclare all the vertables and arnays If ingut voltidation II Nead dato fron Reyboard and populote arroys If call the selection sort function II Setectionsort (nubberitist, mabernec); ousploy the sorted ornay void selectionsort (int numberst], int slie) I/ body of the function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
