Beispiel #1
0
        public static void getInput()
        {
            Console.WriteLine("hello world");
            Console.Write("Length: ");
            String input = Console.ReadLine();
            //Convert.ToDouble(input);
            double length = Double.Parse(input);

            Console.Write("Width: ");
            input = Console.ReadLine();
            double   width = Double.Parse(input);
            Program2 p     = new Program2();
            int      w     = (int)State.Complete;

            p.setDimens(length, width);
            Cube c = new Cube();

            c.setDimens(3, 3);
            c.setHeight(3);
            c.setVolume();
            Console.WriteLine("Cube Volume = {0}", c.getVolume());
            Console.WriteLine("Length = {0}\nWidth = {1}\nArea = {2}\nVar = {3}", p.getLength(), p.getWidth(), p.getArea(), p.getVar());
            dynamic z = p.getVar();

            if (z is double)
            {
                p1();
            }
            else
            {
                p2();
            }
            int row = (int)z;

            if (z is double)
            {
                p1();
            }
            else
            {
                p2();
            }
            Console.WriteLine("Var = {0}", z);
            Books Book1 = new Books();

            Book1.setValues("1984", "George Orwell", 345, 109091561);
            Book1.display();
            Cube c2 = new Cube();

            c2.setDimens(3, 3);
            c2.setHeight(3);
            c2.setVolume();
            Shape c3 = new Cube();

            c3 = c2 + c;
            c3.setVolume();
            Console.WriteLine("C3 = {0}, {1}, {2}, {3}", c3.getWidth(), c3.getLength(), c3.getVolume(), c3.getHeight());
            Console.ReadKey();
            //recursivePrint("Hello", row);
            //for(int i = row; i > 0; i--)
            //{
            //    Console.WriteLine(Program2.arr[i-1]);
            //}
            primes2(1000000);     //one billion tried -> 1million
        }