Example #1
0
        public int Tambah(int a, int b)
        {
            try
            {
                return(a + b);
            }

            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);

                MathFault mf = new MathFault();
                mf.Kode  = "Inputan yang anda massukan salah";
                mf.Pesan = "Masukan input yang benar";
                throw new FaultException <MathFault>(mf);
            }
        }
Example #2
0
        public Koordinat TKoordinat(Koordinat a, Koordinat b)
        {
            try
            {
                Koordinat hasil = new Koordinat();
                hasil.X = a.X + b.X;
                hasil.Y = a.Y + b.Y;
                return(hasil);
            }

            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);

                MathFault mf = new MathFault();
                mf.Kode  = "Inputan yang anda massukan salah";
                mf.Pesan = "Masukan input yang benar";
                throw new FaultException <MathFault>(mf);
            }
        }