title: The process will be repeated until the user enters the sentinel value, which is -1
body: <p>i college assignement to do , I'm done all the code except one thing
  they asked us (The process will be repeated until the user enters the sentinel value, which is -1)
  how to do this step in java ?</p>