Пример #1
0
        static void Main(string[] args)
        {
            //membuat object taxi
            Taxi taxi = new Taxi();

            //set nilai properties
            taxi.DriverName   = "Joni";
            taxi.OnDuty       = true;
            taxi.NumPassenger = 10;

            //panggil method
            taxi.TaxiInfo();
            taxi.PickUpPassenger();
            taxi.DropOffPassenger();

            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            // membuat objek taxi dari class Taxi
            Taxi taxi = new Taxi();

            // set nilai properties
            taxi.DriverName   = "Verry";
            taxi.OnDuty       = true;
            taxi.NumPassenger = 10;

            // pemanggilan methods
            taxi.TaxiInfo();
            taxi.PickUpPassenger();
            taxi.DropOffPassenger();

            Console.ReadKey();
        }