Question: Design a program that asks the user to enter 10 golf scores. The scores should be stored in an Integer array. Sort the array in
Design a program that asks the user to enter 10 golf scores. The scores should be stored in an Integer array. Sort the array in ascending order and display its contents. Need the pseudocode in this format. 
1 Module main) 2Constant for the array size 6 3 Constant Integer SIZE 5 11 An array of Integers 6 Declare Integer numbers[SIZE] -4, 6, 1, 3, 5, 2 8 1 Loop counter 9 Declare Integer index 10 11 IDisplay the array in its original order. 12 Display "Original order: 13 For index 0 To SIZE 1 14 15 End For Display numbers[ index] Sort the numbers 17 18 19 Call selectionSort (numbers, SIZE) 20 21 Display a blank line. Display 23 I Display the sorted array. 24 Display "Sorted order: 25 Por index = 0 To SIZE- 1 26 27 End For 28 End Nodule 29 30 // The selectionsort module accepts an array of integers 31 // and the array's size as arguments. When the module is 32 // finished, the values in the array will be sorted in 33 // ascending order. 34 Module selectionsort (Integer Ref arrayl, Integer arraysize) 35 startscan will hold the starting position of the scan. 36 Declare Integer startScan 37 Display numbersl index] 38 I minIndex will hold the subscript of the element with smallest value found in the scanned area. 39 / the smalles 40 Declare Integer minIndex minvalue will hold the smallest value found in the scanned area. 44 Declare Integer minValue 45 46 /1 index is a counter variable used to hold a subscript. 47 Declare Integer index 4 8 49 I The outer loop iterates once for each element in the s0 / array, except the last element. The startscan variable s1 // marks the position where the scan should begin
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
