Пример #1
0
        public void RunExercise()
        {
            NumberPrinter np = new NumberPrinter();

            np.SetLowest(3.14159);
            np.SetHighest(12);
            np.Print(true);
            np.SetHighest(17.1);
            np.Print(false);
            np.SetLowest(17); // note that lo == hi
            np.Print(false);  // no output
            np.SetLowest(22); // note that lo > hi
            np.Print(false);  // no output
            //Instance variables are variables within a class
            //Local variables are variables initialized in a method.
            //Parameters are essentially passers of a value declared as a local variable in a method.
        }
Пример #2
0
        public void RunExercise()
        {
            NumberPrinter np = new NumberPrinter();

            np.PrintNumbers(-5, 2); // this will print the numbers -3 -2 -1 0 1 2
        }
Пример #3
0
        static void Main(string[] args)
        {
            // This code is used by the first exercise
            // It is left here, uncommented, so that it's easy for you to run
            // Once you complete it, feel free to comment these lines out
            // That way, you won't have every single exercise being run, each and
            // every time :)
            IO_Operators ioo = new IO_Operators();
            ioo.RunExercise();

            Fibonnaci_With_Array fwa = new Fibonnaci_With_Array();
            fwa.RunExercise();

            //Scope_Of_Variables sov = new Scope_Of_Variables();
            //sov.RunExercise();
            NumberPrinter np = new NumberPrinter();
            np.SetLowest(3.14159);
            np.SetHighest(12);
            np.Print(true);
            np.SetHighest(17.1);
            np.Print(false);

            Object_Composition_Circle occ = new Object_Composition_Circle();
            occ.RunExercise();

            Array_Of_Ints aoi = new Array_Of_Ints();
            aoi.RunExercise();
        }