private void FrmHasil_OnPerhitungan(int index, float a, float b) { var cal = new Calculator(); if (index == 0) { lstHasil.Items.Add(string.Format("Hasil Penjumlahan {0} + {1} = {2}", a, b, cal.Penjumlahan(a, b))); } else if (index == 1) { lstHasil.Items.Add(string.Format("Hasil Pengurangan {0} - {1} = {2}", a, b, cal.Pengurangan(a, b))); } else if (index == 2) { lstHasil.Items.Add(string.Format("Hasil Perkalian {0} * {1} = {2}", a, b, cal.Perkalian(a, b))); } else { lstHasil.Items.Add(string.Format("Hasil Pembagian {0} / {1} = {2}", a, b, cal.Pembagian(a, b))); } }