Welcome to the Data Store!
You will repeatedly be given the opportunity to add numeric values to storage,
print the currently stored values, search the storage for specific values,
get help, or quit the program.
We'll get started by displaying the available commands:
Available commands:
H - print this help menu
P - print the values currently in storage
A - add a new number to storage
(you'll be given another prompt to enter your number)
C - count how often a given number appears in storage
(you'll be given another prompt to enter your number)
Q - quit the program
Please enter a command [ H P A C or Q ]: P
There is currently no data stored
Please enter a command [ H P A C or Q ]: A
Please enter the number: 27
27 added to the data store
Please enter a command [ H P A C or Q ]: A
Please enter the number: -1.2
-1.2 added to the data store
Please enter a command [ H P A C or Q ]: p
Currently stored:
27
-1.2
Please enter a command [ H P A C or Q ]: X
That is not a valid command choice
Please enter a command [ H P A C or Q ]: a
Please enter the number: foo
That was not a number
Please enter the number: 27
27 added to the data store
Please enter a command [ H P A C or Q ]: P
Currently stored:
27
-1.2
27
Please enter a command [ H P A C or Q ]: C
Please enter the number: 27
27 appears 2 times in the data store
Please enter a command [ H P A C or Q ]: H
Available commands:
H - print this help menu
P - print the values currently in storage
A - add a new number to storage
(you'll be given another prompt to enter your number)
C - count how often a given number appears in storage
(you'll be given another prompt to enter your number)
Q - quit the program
Please enter a command [ H P A C or Q ]: Q
Shutting down, bye!
|