title: How to integrate a loop in my code
body: <p>I am new to Java.  My program first gets inputs from the user about their car, and then it shows the result. 
  I need to integrate my "Rövarspråk" in to the code, but I am not really sure how. 
  If the user owns a "Saab" or a "Volvo" the "rövarspråk" loop should change the user's "string name". 
  If something is unclear, just tell me and I'll try to explain better.</p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>public static void main(String[] args) {
      String lookSaab;
  
      String consonantsx;
      String input;
      String slang;
      String add;
      // String
      int length;
      // int
      Scanner skriv;
      // Scanner
  
      String reg;
      String year;
      String brand;
      String name;
      String car;
      String when;
      String small;
      String medium;
      String big;
      // String 
      int mod;
      int randomNumber;
      int quota;
      int denominator;
      // int
  
  
  
  
  
  
  
      reg = JOptionPane.showInputDialog("Ange registreringsnummer"); // Input plate number of your car
      year = JOptionPane.showInputDialog("Ange årsmodell"); // Input model year of the car
      mod = Integer.parseInt(year); 
      brand = JOptionPane.showInputDialog("Ange bilmärke"); //Input car brand
      name = JOptionPane.showInputDialog("Ange ägare "
                                             + "(för - och efternamn)"); //Input owner of the car first name + last name
      car = brand + reg;
      Date date = new Date();
      java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("EEE MMM dd");
      when = sdf.format(date);
      denominator = 1500;
      randomNumber = 1500 + (int)(Math.random() * ((40000 - 1500) + 1));
      quota = randomNumber / denominator;
  
      small = "Liten service"; 
      medium = "Medium service";
      big = "Stor service";
      if (randomNumber &lt;= 8000){
          JOptionPane.showMessageDialog(null, small, "Typ av service", 1);
      } else if ( randomNumber &lt;= 20000){ 
          JOptionPane.showMessageDialog(null, medium, "Typ av service", 1);
      } else {
          JOptionPane.showMessageDialog(null, big, "Typ av service", 1);
      }
  
      String resultat = "Bil: " + car + "\n" 
                        + "Årsmodell: " + mod + "\n"  
                        + "Ägare: " + name + "\n"  
                        + "Mästarställning: " + randomNumber + "\n"  
                        + "Inlämnad: " + when + "\n"  
                        + "Klar om: " + quota + " dagar";
      JOptionPane.showMessageDialog(null, resultat, "Resulat", 1);
  
      lookSaab = "Saab";
  
      if (brand.equals(lookSaab)){
  
      }
  
    /* Rövarspråket */
  
  
  
      consonantsx = "bBcCdDeEfFgGhHjJkKlLmMnNpPqQrRsStTvVwWxXzZ"; //Saves all consonants to string
  char consonants[] = consonantsx.toCharArray();  //String to charr
  
  System.out.println("Mata in en mening");
  skriv = new Scanner(System.in);
  input = skriv.nextLine();   //Saves the input
  length = input.length();    //Length inc. space
  char array[] = input.toCharArray(); // Input to a char array
  
  slang = "";
      System.out.println("På rövarspråk:"); 
  for(int i = 0; i&lt;length; i++) {
          for(int x = 0; x&lt;20; x++){
              if(array[i] == consonants[x])
              {
                  add = array[i]+"o"+array[i];
                  slang = slang + add;
                  break;
              }
              else{
              }
          }
      }
      System.out.println(slang);
  }
  }
  </code></pre>