Skip to content

Instantly share code, notes, and snippets.

@b-adams
Created November 13, 2011 20:45
Show Gist options
  • Save b-adams/1362664 to your computer and use it in GitHub Desktop.
Save b-adams/1362664 to your computer and use it in GitHub Desktop.
Sample output from Program 7
$ ./program_7_solution
MAIN MENU:
-----------------------------------
(a) Input data automatically
(b) Input data manually (BAD IDEA!)
-----------------------------------
(c) Display all array contents
(d) Display all contents, backward
(e) Display contents in a range
(f) Display evenly spaced contents
-----------------------------------
(g) Find total of all data
(h) Find average of all data
(i) Find minimum of all data
(j) Find maximum of all data
(k) Find number of data in a range
(l) Find if a number is in the data
-----------------------------------
(?) Display this menu
(*) Quit program
-----------------------------------
Please enter your choice (? for menu): a
Choice 'a' selected.
Autofilling data.
Please enter your choice (? for menu): e
Choice 'e' selected.
Please enter the low end of your range: 500
Please enter the high end of your range: 510
Displaying all data between 500 and 510
index 761: content 510
index 828: content 503
index 905: content 509
Please enter your choice (? for menu): f
Choice 'f' selected.
Please enter where you wish to start: 7
Please enter how many to skip each time: 200
Displaying entries from 7 by 200:
index 7: content 6
index 207: content 33
index 407: content 178
index 607: content 541
index 807: content 566
Please enter your choice (? for menu): g
Choice 'g' selected.
The total is 243405
Please enter your choice (? for menu): h
Choice 'h' selected.
The average is 243
Please enter your choice (? for menu): i
Choice 'i' selected.
The minimum is 0
Please enter your choice (? for menu): j
Choice 'j' selected.
The maximum is 960
Please enter your choice (? for menu): k
Choice 'k' selected.
Please enter the low end of your range: 500
Please enter the high end of your range: 510
There are 3 data between 500 and 510
Please enter your choice (? for menu): l
Choice 'l' selected.
Please enter the number you wish to find: 960
960 is in the list.
Please enter your choice (? for menu): l
Choice 'l' selected.
Please enter the number you wish to find: 961
961 is not in the list.
Please enter your choice (? for menu): ?
Choice '?' selected.
MAIN MENU:
-----------------------------------
(a) Input data automatically
(b) Input data manually (BAD IDEA!)
-----------------------------------
(c) Display all array contents
(d) Display all contents, backward
(e) Display contents in a range
(f) Display evenly spaced contents
-----------------------------------
(g) Find total of all data
(h) Find average of all data
(i) Find minimum of all data
(j) Find maximum of all data
(k) Find number of data in a range
(l) Find if a number is in the data
-----------------------------------
(?) Display this menu
(*) Quit program
-----------------------------------
Please enter your choice (? for menu): c
Choice 'c' selected.
Displaying data forward
index 0: content 0
index 1: content 1
index 2: content 2
index 3: content 2
index 4: content 0
index 5: content 2
index 6: content 2
index 7: content 6
index 8: content 8
index 9: content 9
index 10: content 6
[[One, two, skip a few, this part edited for your sanity]]
index 989: content 387
index 990: content 427
index 991: content 342
index 992: content 290
index 993: content 749
index 994: content 832
index 995: content 779
index 996: content 586
index 997: content 631
index 998: content 927
index 999: content 230
Please enter your choice (? for menu): d
Choice 'd' selected.
Displaying data backward
index 999: content 230
index 998: content 927
index 997: content 631
index 996: content 586
index 995: content 779
index 994: content 832
index 993: content 749
index 992: content 290
index 991: content 342
index 990: content 427
index 989: content 387
[[One, two, skip a few, this part edited for your sanity]]
index 10: content 6
index 9: content 9
index 8: content 8
index 7: content 6
index 6: content 2
index 5: content 2
index 4: content 0
index 3: content 2
index 2: content 2
index 1: content 1
index 0: content 0
Please enter your choice (? for menu): ?
Choice '?' selected.
MAIN MENU:
-----------------------------------
(a) Input data automatically
(b) Input data manually (BAD IDEA!)
-----------------------------------
(c) Display all array contents
(d) Display all contents, backward
(e) Display contents in a range
(f) Display evenly spaced contents
-----------------------------------
(g) Find total of all data
(h) Find average of all data
(i) Find minimum of all data
(j) Find maximum of all data
(k) Find number of data in a range
(l) Find if a number is in the data
-----------------------------------
(?) Display this menu
(*) Quit program
-----------------------------------
Please enter your choice (? for menu): a
Choice 'a' selected.
Autofilling data.
Please enter your choice (? for menu): h
Choice 'h' selected.
The average is 253
Please enter your choice (? for menu): a
Choice 'a' selected.
Autofilling data.
Please enter your choice (? for menu): h
Choice 'h' selected.
The average is 249
Please enter your choice (? for menu): a
Choice 'a' selected.
Autofilling data.
Please enter your choice (? for menu): h
Choice 'h' selected.
The average is 259
Please enter your choice (? for menu): *
Choice '*' selected.
Goodbye.$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment