Edhesive Assignment 5 help
jedifan65 (3)

So my code manages to run every sample run correctly except for sample run 4 which has it as a decreasing array instead of an unsorted array:
Sample Run 1
How long do you want the array?
3
Enter a number
1.3
Enter a number
1.5
Enter a number
8.1
Your array is {1.3, 1.5, 8.1}
The average is 3.633333333333333
The range is 6.8
The array is sorted in increasing order

Sample Run 2
How long do you want the array?
-3
Not a valid length!

Sample Run 3
How long do you want the array?
2
Enter a number
3.6
Enter a number
0.8
Your array is {3.6, 0.8}
The average is 2.2
The range is 2.8
The array is sorted in decreasing order

Sample Run 4
How long do you want the array?
5
Enter a number
2.0
Enter a number
4.1
Enter a number
6.4
Enter a number
0.2
Enter a number
1.3
Your array is {2.0, 4.1, 6.4, 0.2, 1.3}
The average is 2.8
The range is 6.2
The array is unsorted

Here's my code:https://repl.it/@jedifan65/assignment-5-array-statistics
Please help me. This assignment is due today.
EDIT: Please help

You are viewing a single comment. View All
AllAwesome497 (367)

Instead of pasting the code here, link the repl to the post. Dong so not only makes it readable, but it also lets us see firsthand and easily fork+edit it, so that we can better help you.

jedifan65 (3)

@AllAwesome497 Sorry about that. I'm new to this website, so forgive me for not being clear about everything. https://repl.it/@jedifan65/assignment-5-array-statistics