Page 59 - E-Modul Pemrograman Dasar
P. 59

Using System;
                        using System.Collections.Generic;
                        using System.Linq;
                        using System.Text;


                        namespace ConsoleApplication1
                        {
                               class billingException: ApplicationException

                               {
                                       public billingException()
                                              : base("Nilai tidak boleh kurang dari 1000")
                               {
                               }
                               public int calculate(int amount)

                               {
                                       int total;
                                       if (amount < 1000)
                                       {

                                              throw new billingException();
                                       }
                                       Else
                                       {
                                              total amount - 1000;

                                              Console.WriteLine("Kelebihan nilai yaitu" + total);
                                       }
                                       return total;
                               }

                        }
                        class Program
                        {
                               static void Main(string[] args)
                               {

                                       try
                                       {







                                                             50
   54   55   56   57   58   59   60   61   62   63   64