コード例 #1
0
ファイル: teht1.cs プロジェクト: K2381/TTOS0200
        public static void TestiPvm()
        {
            string[] testaukset = { "1.2.13", "1.10.2017", "12.12.2017", "24.12.2017", "12,12,2017", "12.13.2017", "30.2.2017", "23-02-2013", "23/3/2383", "9.26.2017" };

            foreach (var test in testaukset)
            {
                Console.WriteLine(Teht1.OnkoPvm(test));
            }
        }
コード例 #2
0
ファイル: teht1.cs プロジェクト: K2381/TTOS0200
        public static void TestiLuku()
        {
            string[] testaukset = { "Kissa", "abcABC1", "1234.", "1234.5", ",1234", "1234,", "12-34,", "123,4214,3", "0", "123", "123,43", "+123", "-123", "+123,45", "-123,43" };

            foreach (var test in testaukset)
            {
                Console.WriteLine(Teht1.OnkoLuku(test));
            }
        }
コード例 #3
0
        static void Menu()
        {
            int  menuSelector;
            bool GoodInt;


            do
            {
                Console.Clear();
                Console.WriteLine("1 Kiuas");
                Console.WriteLine("2 Pesukone");
                Console.WriteLine("3 TV");
                Console.WriteLine("4 Car");
                Console.WriteLine("5 Students");
                Console.Write("Valitse tehtävä:");
                while (GoodInt = int.TryParse(Console.ReadLine(), out menuSelector) == false)
                {
                    ;
                }


                switch (menuSelector)
                {
                case 1:
                    Teht1 kiuas = new Teht1();
                    kiuas.KiuasMain();
                    break;

                case 2:
                    Teht2 wash = new Teht2();
                    wash.WashingMain();
                    break;

                case 3:
                    Teht3 tv = new Teht3();
                    tv.TVMain();
                    break;

                case 4:
                    Teht4 car = new Teht4();
                    car.CarMain();
                    break;

                case 5:
                    Teht5 students = new Teht5();
                    students.StudentsMain();
                    break;
                }
            } while (menuSelector != 0);
        }