static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Hotels in Miami!");                                        //Welcome to Hotel Reservation System

            inputFromUserserInput();                                                                 //Input Date Range and Customer Type from User

            HotelReservation hotelReservation = new HotelReservation();

            AddSampleHotels(hotelReservation);                                                        //Add Hotel Name to HotelList

            //Find the cheapest hotel in the date Range
            var cheapestHotels = hotelReservation.FindCheapestHotels(startDate, endDate, customerType);
            var cost           = hotelReservation.CalculateTotalCost(cheapestHotels[0], startDate, endDate, customerType);

            //Print the name and cost
            Console.WriteLine("Hotel: {0}, Total Cost : {1}", cheapestHotels[0].name, cost);                        //Print the Name of first Element if same

            //Best Rated Hotel in the date Range
            var bestRatedHotel = hotelReservation.FindBestRatedHotel(startDate, endDate);

            Console.WriteLine("Hotel: {0} Rating: {1}", bestRatedHotel[0].name, bestRatedHotel[0].rating);

            //Best and cheapest hotels

            var bestandcheapesthotel = hotelReservation.FindCheapestBestRatedHotel(endDate, endDate, customerType);
            var totalcost            = hotelReservation.CalculateTotalCost(cheapestHotels[0], startDate, endDate, customerType);

            Console.WriteLine("Hotel: {0} Rating {1} Cost ", bestandcheapesthotel[0].name, bestandcheapesthotel[0].rating, cost);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Hotel Reservation Program:\n");
            HotelReservation.AddRatingsAndHotel();
            bool flag = true;

            while (flag)
            {
                Console.WriteLine("\nEnter:\n1.To find cheapest hotels\n2.To find best rated hotel\n3.To find cheapest best rated hotel\n4.To exit\n");
                int options = Convert.ToInt32(Console.ReadLine());
                switch (options)
                {
                case 1:
                    //UC 2
                    HotelReservation.FindCheapestHotel();
                    break;

                case 2:
                    //UC 7
                    HotelReservation.FindBestRatedHotel();
                    break;

                case 3:
                    //UC 6
                    HotelReservation.FindCheapestBestRatedHotel();
                    break;

                case 4:
                    flag = false;
                    break;
                }
            }
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Hotel Reservation Program:\n");
            //Addition of hotel with ratings into records
            HotelReservation.AddRatingsAndHotel();
            //Choosing if the user is regular or rewards
            Console.WriteLine("Enter:\n1.If you are a REGULAR customer\n2.If you are a REWARDS customer");
            int          customerTypeChoice = Convert.ToInt32(Console.ReadLine());
            CustomerType customerType;

            if (customerTypeChoice == 1)
            {
                customerType = CustomerType.REGULAR_CUSTOMER;
            }
            else
            {
                customerType = CustomerType.REWARDS_CUSTOMER;
            }
            //Getting dates from user
            Console.WriteLine("Enter the check-in date(DDMMMYYYY):");
            DateTime checkinDate = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("Enter the check-out date(DDMMMYYYY):");
            DateTime checkoutDate = DateTime.Parse(Console.ReadLine());

            bool flag = true;

            while (flag)
            {
                Console.WriteLine("\nEnter:\n1.To find cheapest hotels\n2.To find best rated hotel\n3.To find cheapest best rated hotel\n4.To exit\n");
                int options = Convert.ToInt32(Console.ReadLine());
                switch (options)
                {
                case 1:
                    //UC 2
                    HotelReservation.FindCheapestHotel(checkinDate, checkoutDate, customerType);
                    break;

                case 2:
                    //UC 7
                    HotelReservation.FindBestRatedHotel(checkinDate, checkoutDate, customerType);
                    break;

                case 3:
                    //UC 6
                    HotelReservation.FindCheapestBestRatedHotel(checkinDate, checkoutDate, customerType);
                    break;

                case 4:
                    flag = false;
                    break;
                }
            }
        }
Esempio n. 4
0
 //UC7          
 public static void FindBest(HotelReservation hotelReservation, CustomerType ct)
 {
     Console.WriteLine("Best Rated Hotel");
     Console.Write("Enter the date range : ");
     var input = Console.ReadLine();
     string[] dates = input.Split(',');
     try
     {
         var startDate = Convert.ToDateTime(dates[0]);
         var endDate = Convert.ToDateTime(dates[1]);
         var cheapestHotel = hotelReservation.FindBestRatedHotel(startDate, endDate);
         foreach (Hotel h in cheapestHotel)
         {
             var cost = hotelReservation.CalculateTotalCost(h, startDate, endDate, ct);
             Console.WriteLine("Hotel : {0}, Rating: {1}, Total Cost : {2}", h.name, h.rating, cost);
         }
     }
     catch
     {
         Console.Write("Enter the correct date range \n");
         FindBest(hotelReservation, ct);
     }
 }
 public static void FunctionForCustomerType(int type)
 {
     HotelReservation.FindCheapestHotel(type);
     HotelReservation.FindCheapestBestRatedHotels(type);
     HotelReservation.FindBestRatedHotel(type);
 }