how to ask the user for a range?

Apr 3, 2015 at 7:36pm
whats the format for asking the user to select a range of numbers from zero to a positive number? and that the number they put in is the top of the range ?
Apr 3, 2015 at 7:40pm
You can create an array with a bunch of numbers. Display all the numbers in the array, make them choose a number. If you want to make sure they chose the biggest number(thats what I assume you mean from the top of the range) you can use a function to get the highest number in the array and see if they match.

Ive probably misunderstood, your question was very vague and not very clear. An example would help.
Last edited on Apr 3, 2015 at 7:40pm
Apr 3, 2015 at 7:41pm
example would be, like a guessing game where you ask the user for a number input, so the range that the generator could select would be between zero and the number they selected.
Apr 3, 2015 at 7:42pm
im not sure how to ask for there input or what to write for it
Apr 3, 2015 at 7:47pm
Apr 4, 2015 at 1:37am
Are you asking for a user to input a range, inclusive?

Could always ask then to input the bottom of the range, set that to x, then have them input the top, y, and use those values to define the range, inclusive.
Topic archived. No new replies allowed.