title: Why won't my break work in my java loop
body: <pre><code>    String prompt;
      boolean promptB;
  
      runLoop:
  
      do{
          Scanner input = new Scanner (System.in);
          System.out.println("Enter a number, a space and F to convert from degF to degC and C to convert to degC to degF");
  
          if(input.hasNextDouble()){
              double deg = input.nextDouble();
              String letter = input.next().toUpperCase();
              char dg = letter.charAt(0);
  
              tempLoop:
  
              if( dg == 'C' || dg == 'c'){
  
                  double cTemp= (double)(deg-32)*(5.0/9.0);
                  System.out.printf("%f degC converted to degF is %.2f%n ", deg, cTemp );
              }
              else if(dg == 'F' || dg == 'f'){
                  double fTemp = (double) (deg*9/5) + 32;
                  System.out.printf("%f degF converted to degC is %.2f%n ", deg, fTemp );
              }
              else{
                  System.out.println("That character does not correspond to a valid unit of measure ");
                  break tempLoop;
              }
              do{
                  System.out.println("Would you like to continue?(yes/no)");
                  prompt = input.next().toLowerCase();
  
                  if(prompt.equals("yes")){
                      promptB = false;
  
                  } else if (prompt.equals("no")){
                      promptB = false;
                      break;
  
                  }else{
                      promptB = true;
                      System.out.println("Would you like to continue? yes or no");
                      prompt = input.next();
                  }
  
              }while(promptB);
          }
          else{
              System.out.println("must enter in a valid number for degrees");
              break runLoop;
          }
      }while(prompt.equalsIgnoreCase("yes"));
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Here is the code I currently  have. I cannot figure out how to re execute the runLoop: if the input.hasNextDouble() is not true or the user has input letters instead of a double. any info ideas are greatly welcomed </p>