This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
OtpComposeTheme { | |
val (pinValue,onPinValueChange) = remember{ | |
mutableStateOf("") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Alternatif(var kode: String, var nama: String) : Comparable<Alternatif> { | |
var nilai = 0.0 | |
override fun toString(): String { | |
return String.format("%s-%s:%.3f", kode, nama, nilai) | |
} | |
override fun compareTo(a: Alternatif): Int { | |
return java.lang.Double.compare(this.nilai, a.nilai) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FragmentAdapter( | |
fragmentManager: FragmentManager | |
) : FragmentPagerAdapter(fragmentManager) { | |
val mFragmentList: ArrayList<Fragment> = ArrayList() | |
private val mFragmentTitleList: MutableList<String> = mutableListOf() | |
override fun getItem(position: Int): Fragment { | |
return mFragmentList[position] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentPagerAdapter; | |
import android.support.v4.view.ViewPager; | |
public class MainActivity extends AppCompatActivity { | |
static final int NUMBER_OF_PAGES = 2; | |
MyAdapter mAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Means{ | |
public int jumlah = 0; //deklarasi jumlah awal | |
public Means(){ | |
//deklarasi Constructor | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class last_task{ | |
public static void main(String[] args){ | |
String kata ; //Deklarasi -- variabel kata tipe data String | |
Scanner keyboard = new Scanner(System.in); //Deklarasi -- keyboard untuk inputan sebagai objek baru dari scanner | |
System.out.print("Input your secret word : "); //Output -- petunjuk memasukan kata | |
kata = keyboard.nextLine();//Inisialiasi -- variabel kata dengan masukkan dari keyboard user | |
System.out.println("Terenkripsi - " + cipher(kata, 5)); //Output -- "Terenkripsi" | |
//Call -- Pemanggilan method/fungsi cipher dengan parameter kata dan int 3 |