Exemplo n.º 1
0
 public Route(int milageOrigin, int milageDestination, string origin, string destination, JourneyTypeEnum journeyTypeEnum = JourneyTypeEnum.Work)
 {
     this.Origin            = origin;
     this.Destination       = destination;
     this.MilageOrigin      = milageOrigin;
     this.MilageDestination = milageDestination;
     this.JourneyType       = journeyTypeEnum;
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Is it a work journey? y/n)");
            var work = Console.ReadLine().ToLower();

            JourneyType = work.Equals("n") ? JourneyTypeEnum.Private : JourneyTypeEnum.Work;

            Console.WriteLine("Input start milage: ");
            MilageOrigin = Int32.Parse(Console.ReadLine());
            Console.WriteLine("Input origin: ");
            Origin = Console.ReadLine();

            Console.WriteLine("Input end milage: ");
            MilageDestination = Int32.Parse(Console.ReadLine());
            Console.WriteLine("Input destination: ");
            Destination = Console.ReadLine();

            var route = new Route(MilageOrigin, MilageDestination, Origin, Destination, JourneyType);

            Console.WriteLine(route.SummorizeRoute());
        }