Ejemplo n.º 1
0
        /// <summary>
        /// A simple room booking system
        /// </summary>
        private static void TestMotelBooking()
        {
            BatesMotel motel = new BatesMotel();

            SimpleIO.WriteTitle("The Bates Motel", "Task 5.6");
            motel.RunMotel();

            Console.ReadKey();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Task 4.2 Create a Book object and test that it writes chapter 1 and 2
        /// Task 4.3 Add a Book Constructor method to initialise all the attributes
        /// </summary>
        private static void TestBook()
        {
            Book book = new Book();

            SimpleIO.WriteTitle("Horror Story", "Task 4.1");

            //book.GetDetails();
            book.WriteChapter1();
            book.WriteChapter2();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Task 4.1 Create a Converter and check that it converts between
        /// miles and feet using double numbers
        /// </summary>
        public static void TestDistanceConverter()
        {
            double miles = 1;
            double feet  = 0;

            Console.WriteLine("Eric's Distance Converter");
            DistanceConverter converter = new DistanceConverter();
            int choice = 3;

            string[] choices = new string[]
            {
                "1. Convert Miles to Feet",
                "2. Convert Feet to Miles",
                "3. Quit Test"
            };
            do
            {
                choice = SimpleIO.GetChoice(choices);

                if (choice == 1)
                {
                    miles = converter.GetDouble("Miles");
                    feet  = converter.ToFeet(miles);

                    Console.WriteLine("The no. of miles = " + miles);
                    Console.WriteLine("The no. of feet = " + feet);
                }
                else if (choice == 2)
                {
                    feet  = converter.GetDouble("Feet");
                    miles = converter.ToMiles(feet);

                    Console.WriteLine("The no. of feet = " + feet);
                    Console.WriteLine("The no. of miles = " + miles);
                }
            } while (choice != 3);
        }