Habibi Imron

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package konversi;

import java.util.Scanner;

/**

*

* @author habibi 133040228

*/

public class Konversi {

public static void satuan (int a){

if(a==1){

System.out.print("Satu ");

}else if(a==2){

System.out.print("Dua ");

}else if(a==3){

System.out.print("Tiga ");

}else if(a==4){

System.out.print("Empat ");

}else if(a==5){

System.out.print("Lima ");

}else if(a==6){

System.out.print("Enam ");

}else if(a==7){

System.out.print("Tujuh ");

}else if(a==8){

System.out.print("Delapan ");

}else if(a==9){

System.out.print("Sembilan ");

}else if(a==10){

System.out.print("Sepuluh ");

}else if(a==11){

System.out.print("Sebelas ");

}

}

public static void terbilang(int b){

if(b<=11){

satuan(b);

}else if(b>11 && b<=19){

terbilang(b%10);

System.out.print("Belas ");

}else if(b>=20 && b<=99){

terbilang(b/10);

System.out.print("Puluh ");

terbilang(b%10);

}else if(b>=100 && b<=199){

System.out.print("Seratus ");

terbilang(b%100);

}else if(b>=200 && b<=999){

terbilang(b/100);

System.out.print("Ratus ");

terbilang(b%100);

}else if(b>=1000 && b<=1999){

System.out.print("Seribu ");

terbilang(b%1000);

}else if(b>=2000 && b<=9999){

terbilang(b/1000);

System.out.print("Ribu ");

terbilang(b%1000);

}else if(b>=10000 && b<=99999){

terbilang(b/1000);

System.out.print("Ribu ");

terbilang(b%1000);

}else if(b>=100000 && b<=999999){

terbilang(b/1000);

System.out.print("Ribu ");

terbilang(b%1000);

}else if(b>=1000000 && b<=9999999){

terbilang(b/1000000);

System.out.print("Juta ");

terbilang(b%1000000);

}else if(b>=10000000 && b<=99999999){

terbilang(b/1000000);

System.out.print("Juta ");

terbilang(b%1000000);

}else if(b>=100000000 && b<=999999999){

terbilang(b/1000000);

System.out.print("Juta