Test2 - importjava.io.*; importjava.util.*;...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*;  import java.util.*;  public class Test2{    public static Scanner teclado = new Scanner(System.in);  public static String E2(int n){  int acum =0;  String s = "";  while(n>=1){   acum= n%10;  switch(acum){  case 0: s=" Cero " + s; break;  case 1: s=" Uno " + s; break;  case 2: s=" Dos " + s; break;  case 3: s=" Tres " + s; break;  case 4: s=" Cuatro " + s; break;  case 5: s=" Cinco " + s; break;  case 6: s=" Seis " + s; break;  case 7: s=" Siete " + s; break;  case 8: s=" Ocho " + s; break;  case 9: s=" Nueve " + s; break;}  n=n/10;}  return s;}    public static String int2str(int n){  int val = 0;  int exp = 0;  String s = "";  String s1 = Integer.toString(n);  int t=s1.length();  int t2=t;  for(int i=1; i<=t; i++){  exp = (int)(Math.pow(10,(t2-1))); 
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
val = n/exp;  switch(val){  case 0: s+="Cero "; break;  case 1: s+="Uno "; break; 
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/29/2009 for the course ITC TC-1002 taught by Professor X during the Spring '09 term at ITESM.

Page1 / 5

Test2 - importjava.io.*; importjava.util.*;...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online