Search:

Type: Posts; User: belinyom

Search: Search took 0.21 seconds.

  1. Re: [SOLVED] How to output a range of values from arraylist and user input

    I can think of those scenarios in my project. However, the exercise was limited to what it requested from me. I think this is the final solution to the exercise. However, time is against me to work...
  2. Re: [SOLVED] How to output a range of values from arraylist and user input

    What do you mean by the code does not check the user's input for validity?

    You have a point about assigning an int to a variable only, I am used to that. I try to understand my coding more often...
  3. Re: How to output a range of values from arraylist and user input

    Thank you once again




    import java.util.ArrayList;
    import java.util.Scanner;

    public class OnlyTheseNumbers {
  4. Re: How to output a range of values from arraylist and user input

    Quite interesting, even though I struggled with a simple exercise, I did learn a lot.

    I thank you for your insight and understanding.

    I have finally solved the problem, would you like me to...
  5. Re: How to output a range of values from arraylist and user input

    I have tried it numerous times. If a question is asked to the user, the user is able to respond to that question. But in Java, a variable must be declared before a question is asked. If there is a...
  6. Re: How to output a range of values from arraylist and user input

    I do not think that this is possible because I still need to declare a new scanner input variable for 2 values and the declaration has to be done before printing it out. How can I print something...
  7. Re: How to output a range of values from arraylist and user input

    the output should look exactly like this according to the exercise:


    10
    20
    30
    40
    50
    -1
    From where? 0
  8. Re: How to output a range of values from arraylist and user input

    import java.util.ArrayList;
    import java.util.Scanner;

    public class OnlyTheseNumbers
    {

    public static void main(String[] args)
    {
    Scanner inputReader = new...
  9. Re: How to output a range of values from arraylist and user input

    that is really strange: https://imgbox.com/9Wi67jLg

    I have added system.out.println(listOfNumbers) to show the set or collection of array, the loop still did not break. why is the IF condition not...
  10. Re: How to output a range of values from arraylist and user input

    10
    20
    30
    40
    50
    -1
    0
    From where? 0
    2
    To where? 2
  11. Re: How to output a range of values from arraylist and user input

    Thank you for clarifying the concept, I have managed to pull the output as I wanted it to be. But, when I input any random numbers in an array list and try to input -1 to stop the loop, the while...
  12. Re: How to output a range of values from arraylist and user input

    this turned out to be more confusing than I thought

    Why can it return -1 and what is the point of that?

    To clear my confusions,

    .size gives the size of an array by totalling the amount of...
  13. Re: How to output a range of values from arraylist and user input

    Thank you for clarifying that part, I did print out the content of that array list by simply adding system.out.println(listOfNumbers) which shows me the whole set of an array list, if i input 5...
  14. Re: How to output a range of values from arraylist and user input

    I assume -1 was counted as the last index when I stopped the loop from running. How can I exclude -1 from inputNumber (input user in this case) and stop the while loop at the same time?

    Exception...
  15. [SOLVED] How to output a range of values from arraylist and user input

    Hello there, I have been stuck with this exercise for quite some time and I really do not know how to meet its requirements.

    I am trying to input random numbers [10, 20, 30, 40 and 50] to an array...
Results 1 to 15 of 15