title: How do I store in a .txt file the highest number(in words) from input numbers?
body: <p>I am supposed to get the highest number from all input numbers and convert the highest number into words. Numbers in our language actually. I am kind of having trouble in storing it into a .txt file. My program stores the number but not the word, how can I make my program store the word and not the number?</p>
  
  <pre><code>public static int getHighest1(int ... dNums) throws IOException, FileNotFoundException {
      PrintWriter outFile = new PrintWriter("Output1.txt");
  
  
     for (int iCtr=0; iCtr&lt;dNums.length; iCtr++) {
          System.out.println("Values:" +dNums[iCtr]);
      }
  
      int dMax = 0;        
      for (int iCtr=0; iCtr&lt;dNums.length; iCtr++) { 
          if (dMax&lt;dNums[iCtr]) {
              dMax = dNums[iCtr];
          }
      }
  
      outFile.println("Ang pinakamataas na numero ay:" +dMax);
  
      int dTenThousands, dThousands, dHundreds, dTens, dOnes, dRemainder=0;
  
      dTenThousands = dMax/10000;
      dMax = dMax%10000;
      dThousands = dMax/1000;
      dMax = dMax%1000;
      dHundreds = dMax/100;
      dMax = dMax%100;
      dTens = (dMax%100)/10;
  
      if (dMax&gt;10 &amp;&amp; dMax &lt;20) {
          dTens = 0;
          dOnes = 0;
          dRemainder=dMax%10;
      }
  
      else {
          dTens = dMax/10;
          dOnes = dMax;
      }
  
      switch(dTenThousands) {
          case 1: System.out.print("Sampung libo"); break; 
          case 2: System.out.print("Dalawgpung libo"); break;
          case 3: System.out.print("Tatlunpung libo"); break;
          case 4: System.out.print("Apatnapung libo"); break;
          case 5: System.out.print("Limangpung libo"); break;
          case 6: System.out.print("Animnapung libo"); break;
          case 7: System.out.print("Pitongpung libo"); break;
          case 8: System.out.print("Walongpung libo"); break;
          case 9: System.out.print("Siyamnapung libo"); break;
      }
  
      switch(dThousands) {
          case 1: System.out.print("Isang libo"); break; 
          case 2: System.out.print("Dalawang libo"); break;
          case 3: System.out.print("Tatlong libo"); break;
          case 4: System.out.print("Apat na libo"); break;
          case 5: System.out.print("Limang libo"); break;
          case 6: System.out.print("Anim na libo"); break;
          case 7: System.out.print("Pitong libo"); break;
          case 8: System.out.print("Walong libo"); break;
          case 9: System.out.print("Siyam na libo"); break;
      }
  
      switch(dHundreds) {
          case 1: System.out.print("Isandaan"); break; 
          case 2: System.out.print("Dalawandaan"); break;
          case 3: System.out.print("Tatlundaan"); break;
          case 4: System.out.print("Apatnadaan"); break;
          case 5: System.out.print("Limangdaan"); break;
          case 6: System.out.print("Animnaraan"); break;
          case 7: System.out.print("Pitongraan"); break;
          case 8: System.out.print("Walongraan"); break;
          case 9: System.out.print("Siyam naraan"); break; 
      }
  
      switch(dRemainder) {
          case 1: System.out.print("Labingisa"); break; 
          case 2: System.out.print("Labindalawa"); break;
          case 3: System.out.print("Labintatlo"); break;
          case 4: System.out.print("Labing apat"); break;
          case 5: System.out.print("Labinlima"); break;
          case 6: System.out.print("Labing anim"); break;
          case 7: System.out.print("Labing pito"); break;
          case 8: System.out.print("Labing walo"); break;
          case 9: System.out.print("Labing siyam"); break; 
      }
  
      switch(dTens) {
          case 1: System.out.print("Sampu"); break; 
          case 2: System.out.print("Dalawampu"); break;
          case 3: System.out.print("Tatlumpu"); break;
          case 4: System.out.print("Apatnapu"); break;
          case 5: System.out.print("Limampu"); break;
          case 6: System.out.print("Animnapu"); break;
          case 7: System.out.print("Pitumpu"); break;
          case 8: System.out.print("Walumpu"); break;
          case 9: System.out.print("Siyamnapu"); break; 
      }
  
      switch(dOnes) {
          case 1: System.out.print("Isa"); break; 
          case 2: System.out.print("Dalawa"); break;
          case 3: System.out.print("Tatlo"); break;
          case 4: System.out.print("Apat"); break;
          case 5: System.out.print("Lima"); break;
          case 6: System.out.print("Anim"); break;
          case 7: System.out.print("Pito"); break;
          case 8: System.out.print("Walo"); break;
          case 9: System.out.print("Siyam"); break; 
      }
  
      System.out.println("\nAng pinamataas na numero ay:" +dMax);
  
  }
  </code></pre>
  
  <p>My code's not yet finished but I've tried storing my maximumnumber into the output.txt file. But the text file contains the number, not the word, help please? Thank you very much.</p>