static void Main(string[] args) { menghitung hitung = new menghitung(); Console.WriteLine("---KELILING PERSEGI---"); Console.WriteLine(hitung.persegi(5)); Console.WriteLine("---LUAS PERSEGI---"); Console.WriteLine(hitung.luasPersegi(5)); Console.WriteLine("---KELILING PERSEGI PANJANG---"); Console.WriteLine(hitung.persegipanjang(10, 5)); Console.WriteLine("---LUAS PERSEGI PANJANG---"); Console.WriteLine(hitung.LuasPersegipanjang(10, 5)); Console.WriteLine("---LUAS SEGITIGA---"); Console.WriteLine(hitung.luasSegitiga(2, 2)); Console.ReadLine(); }
static void Main(string[] args) { menghitung hitung1 = new menghitung(); Console.Write("Masukkan x : "); double x = double.Parse(Console.ReadLine()); Console.Write("Masukkan y : "); double y = double.Parse(Console.ReadLine()); Console.Write("" + System.Environment.NewLine); Console.Write("Hasil Tambah = "); Console.WriteLine(hitung1.add(x, y)); Console.Write("Hasil Kurang = "); Console.WriteLine(hitung1.min(x, y)); Console.Write("Hasil Kali = "); Console.WriteLine(hitung1.cross(x, y)); Console.Write("Hasil Bagi = "); Console.WriteLine(hitung1.devide(x, y)); Console.ReadLine(); }