How would I match the sample in code? The original and new array are printed out in rows of six integers. Sample#1 Please enter the size of array:7 Please enter an integer:3 Please enter an integer:4 Please enter an integer:8 Please enter an integer:11 Please enter an integer:8 Please enter an integer:3 Please enter an integer:3 Here is a printout of the original array: 3 4 8 11 8 3 3 The sum of all the elements in the array is: 40 The average of all the elements in the array is: 5.71 The max of all the elements in the array is 11 The min of all the elements in the array is: 3 What value you would like to be removed:8 The number of occurrences of 8 in the array is: 2 Here is a printout of the new array with number 8 removed: 3 4 11 3 3 Sample#2 Please enter the size of array:9 Please enter an integer:3 Please enter an integer:4 Please enter an integer:89 Please enter an integer:-10 Please enter an integer:78 Please enter an integer:16 Please enter an integer:85 Please enter an integer:100 Please enter an integer:0 Here is a printout of the original array: 3 4 89 -10 78 16 85 100 0 The sum of all the elements in the array is: 365 The average of all the elements in the array is: 40.56 The max of all the elements in the array is 100 The min of all the elements in the array is: -10 What value you would like to be removed:1 The number of occurrences of 1 in the array is: 0 Here is a printout of the new array with number 1 removed: 3 4 89 -10 78 16 85 100 0 Sample#3 Please enter the size of array:25 Please enter an integer:42 Please enter an integer:21 Please enter an integer:24 Please enter an integer:0 Please enter an integer:93 Please enter an integer:17 Please enter an integer:34 Please enter an integer:2 Please enter an integer:38 Please enter an integer:35 Please enter an integer:29 Please enter an integer:2 Please enter an integer:73 Please enter an integer:1 Please enter an integer:1 Please enter an integer:74 Please enter an integer:3 Please enter an integer:39 Please enter an integer:2 Please enter an integer:40 Please enter an integer:41 Please enter an integer:58 Please enter an integer:58 Please enter an integer:59 Please enter an integer:61 Here is a printout of the original array: 42 21 24 0 93 17 34 2 38 35 29 2 73 1 1 74 3 39 2 40 41 58 58 59 61 The sum of all the elements in the array is: 847 The average of all the elements in the array is: 33.88 The max of all the elements in the array is 93 The min of all the elements in the array is: 0 What value you would like to be removed:1 The number of occurrences of 1 in the array is: 2 Here is a printout of the new array with number 1 removed: 42 21 24 0 93 17 34 2 38 35 29 2 73 74 3 39 2 40 41 58 58 59 61
How would I match the sample in code? The original and new array are printed out in rows of six integers.
Sample#1
Please enter the size of array:7
Please enter an integer:3
Please enter an integer:4
Please enter an integer:8
Please enter an integer:11
Please enter an integer:8
Please enter an integer:3
Please enter an integer:3
Here is a printout of the original array:
3 4 8 11 8 3
3
The sum of all the elements in the array is: 40
The average of all the elements in the array is: 5.71
The max of all the elements in the array is 11
The min of all the elements in the array is: 3
What value you would like to be removed:8
The number of occurrences of 8 in the array is: 2
Here is a printout of the new array with number 8 removed:
3 4 11 3 3
Sample#2
Please enter the size of array:9
Please enter an integer:3
Please enter an integer:4
Please enter an integer:89
Please enter an integer:-10
Please enter an integer:78
Please enter an integer:16
Please enter an integer:85
Please enter an integer:100
Please enter an integer:0
Here is a printout of the original array:
3 4 89 -10 78 16
85 100 0
The sum of all the elements in the array is: 365
The average of all the elements in the array is: 40.56
The max of all the elements in the array is 100
The min of all the elements in the array is: -10
What value you would like to be removed:1
The number of occurrences of 1 in the array is: 0
Here is a printout of the new array with number 1 removed:
3 4 89 -10 78 16
85 100 0
Sample#3
Please enter the size of array:25
Please enter an integer:42
Please enter an integer:21
Please enter an integer:24
Please enter an integer:0
Please enter an integer:93
Please enter an integer:17
Please enter an integer:34
Please enter an integer:2
Please enter an integer:38
Please enter an integer:35
Please enter an integer:29
Please enter an integer:2
Please enter an integer:73
Please enter an integer:1
Please enter an integer:1
Please enter an integer:74
Please enter an integer:3
Please enter an integer:39
Please enter an integer:2
Please enter an integer:40
Please enter an integer:41
Please enter an integer:58
Please enter an integer:58
Please enter an integer:59
Please enter an integer:61
Here is a printout of the original array:
42 21 24 0 93 17
34 2 38 35 29 2
73 1 1 74 3 39
2 40 41 58 58 59
61
The sum of all the elements in the array is: 847
The average of all the elements in the array is: 33.88
The max of all the elements in the array is 93
The min of all the elements in the array is: 0
What value you would like to be removed:1
The number of occurrences of 1 in the array is: 2
Here is a printout of the new array with number 1 removed:
42 21 24 0 93 17
34 2 38 35 29 2
73 74 3 39 2 40
41 58 58 59 61
Step by step
Solved in 5 steps with 7 images