How many values do you wish to store? (1..1000)
7
Enter the next data value (1..4294967295)
10
Enter the next data value (1..4294967295)
3
Enter the next data value (1..4294967295)
17
Enter the next data value (1..4294967295)
2
Enter the next data value (1..4294967295)
9
Enter the next data value (1..4294967295)
4
Enter the next data value (1..4294967295)
8
Enter your command choice [NPRSHQ, H for help]: h
Welcome to the data sorter/slicer
A program to store, sort, slice, and print sets of integer values
The available commands are:
P to print either the stored integer values or the current slice
R to refill part of the stored integer values or the current slice
S to sort a portion of the stored integer values or the current slice
N for a new slice of the current integer values
H to display this menu
Q to quit the program
Enter your command choice [NPRSHQ, H for help]: p
Enter the index of the low array print position (0..6)
0
Enter the index of the high array print position (0..6)
6
value in position 0 is 10
value in position 1 is 3
value in position 2 is 17
value in position 3 is 2
value in position 4 is 9
value in position 5 is 4
value in position 6 is 8
Enter your command choice [NPRSHQ, H for help]: p
Enter the index of the low array print position (0..6)
1
Enter the index of the high array print position (1..6)
5
value in position 1 is 3
value in position 2 is 17
value in position 3 is 2
value in position 4 is 9
value in position 5 is 4
Enter your command choice [NPRSHQ, H for help]: p
Enter the index of the low array print position (0..6)
4
Enter the index of the high array print position (4..6)
4
value in position 4 is 9
Enter your command choice [NPRSHQ, H for help]: n
Creating new slice from array of size 7
Enter the index of the low slice position (0..6)
2
Enter the index of the high slice position (2..6)
5
Enter your command choice [NPRSHQ, H for help]: p
Enter S to work on the current array slice,
or any other character to work on the main values array
s
Enter the index of the low slice print position (0..3)
0
Enter the index of the high slice print position (0..3)
3
value in position 0 is 17
value in position 1 is 2
value in position 2 is 9
value in position 3 is 4
Enter your command choice [NPRSHQ, H for help]: s
Enter S to work on the current array slice,
or any other character to work on the main values array
a
Enter the index of the low array sort position (0..6)
1
Enter the index of the high array sort position (1..6)
6
Sorting array content for positions 1..6
Enter your command choice [NPRSHQ, H for help]: p
Enter S to work on the current array slice,
or any other character to work on the main values array
a
Enter the index of the low array print position (0..6)
0
Enter the index of the high array print position (0..6)
6
value in position 0 is 10
value in position 1 is 2
value in position 2 is 3
value in position 3 is 4
value in position 4 is 8
value in position 5 is 9
value in position 6 is 17
Enter your command choice [NPRSHQ, H for help]: p
Enter S to work on the current array slice,
or any other character to work on the main values array
s
Enter the index of the low slice print position (0..3)
0
Enter the index of the high slice print position (0..3)
3
value in position 0 is 17
value in position 1 is 2
value in position 2 is 9
value in position 3 is 4
Enter your command choice [NPRSHQ, H for help]: s
Enter S to work on the current array slice,
or any other character to work on the main values array
s
Enter the index of the low slice sort position (0..3)
0
Enter the index of the high slice sort position (0..3)
3
Sorting slice content for positions 0..3
Enter your command choice [NPRSHQ, H for help]: p
Enter S to work on the current array slice,
or any other character to work on the main values array
s
Enter the index of the low slice print position (0..3)
0
Enter the index of the high slice print position (0..3)
3
value in position 0 is 2
value in position 1 is 4
value in position 2 is 9
value in position 3 is 17
Enter your command choice [NPRSHQ, H for help]: p
Enter S to work on the current array slice,
or any other character to work on the main values array
a
Enter the index of the low array print position (0..6)
0
Enter the index of the high array print position (0..6)
6
value in position 0 is 10
value in position 1 is 2
value in position 2 is 3
value in position 3 is 4
value in position 4 is 8
value in position 5 is 9
value in position 6 is 17
Enter your command choice [NPRSHQ, H for help]: r
Enter S to work on the current array slice,
or any other character to work on the main values array
a
Enter the index of the low array fill position (0..6)
3
Enter the index of the high array fill position (3..6)
5
Enter the next data value (1..4294967295)
5
Enter the next data value (1..4294967295)
15
Enter the next data value (1..4294967295)
25
Enter your command choice [NPRSHQ, H for help]: p
Enter S to work on the current array slice,
or any other character to work on the main values array
a
Enter the index of the low array print position (0..6)
0
Enter the index of the high array print position (0..6)
6
value in position 0 is 10
value in position 1 is 2
value in position 2 is 3
value in position 3 is 5
value in position 4 is 15
value in position 5 is 25
value in position 6 is 17
Enter your command choice [NPRSHQ, H for help]: r
Enter S to work on the current array slice,
or any other character to work on the main values array
s
Enter the index of the low slice fill position (0..3)
1
Enter the index of the high slice fill position (1..3)
2
Enter the next data value (1..4294967295)
13
Enter the next data value (1..4294967295)
14
Enter your command choice [NPRSHQ, H for help]: p
Enter S to work on the current array slice,
or any other character to work on the main values array
s
Enter the index of the low slice print position (0..3)
0
Enter the index of the high slice print position (0..3)
3
value in position 0 is 2
value in position 1 is 13
value in position 2 is 14
value in position 3 is 17
Enter your command choice [NPRSHQ, H for help]: n
Creating new slice from array of size 7
...deallocating old slice first...
Enter the index of the low slice position (0..6)
1
Enter the index of the high slice position (1..6)
3
Enter your command choice [NPRSHQ, H for help]: p
Enter S to work on the current array slice,
or any other character to work on the main values array
s
Enter the index of the low slice print position (0..2)
0
Enter the index of the high slice print position (0..2)
2
value in position 0 is 2
value in position 1 is 3
value in position 2 is 5
Enter your command choice [NPRSHQ, H for help]: q
Goodbye!
|