예제 #1
0
        private static void stringExercise1()
        {
            Console.WriteLine("Enter a Word or sentence");
            string inputString = Console.ReadLine();

            Console.WriteLine(ListExercise.RemovedelAtIndex1(inputString));
        }
예제 #2
0
        private static void stringExercise6()
        {
            System.Console.WriteLine("Enter your name");
            string inputString = Console.ReadLine();

            Console.WriteLine(ListExercise.Endup(inputString));
        }
예제 #3
0
        private static void stringExercise3()
        {
            Console.Write("String user input:");
            string inputString = Console.ReadLine();

            Console.WriteLine(ListExercise.NotString(inputString));
        }
예제 #4
0
        private static void stringExercise2()
        {
            Console.WriteLine("Enter a Word or sentence");
            string inputString = Console.ReadLine();

            Console.WriteLine(ListExercise.mixStart(inputString));
        }
예제 #5
0
        async private void OnExerciseStarted(object sender, EventArgs e)
        {
            if (listExercise.Count <= 0)
            {
                await DisplayAlert("Note", "you must to add exercises", "OK");

                if (dayexercise.Type.Contains("adult"))
                {
                    await Navigation.PushAsync(new ExercisesAdult
                    {
                        BindingContext = dayexercise
                    });
                }
                else if (dayexercise.Type.Contains("children"))
                {
                    await Navigation.PushAsync(new ExercisesChildren
                    {
                        BindingContext = dayexercise
                    });
                }
            }
            else
            {
                ListExercise listExer = new ListExercise
                {
                    Exercises     = (List <Exercise>) this.listExercise,
                    IndexExercise = 0,
                    DayType       = dayexercise.Type
                };
                var exerciseStart = new ExerciseStart();
                exerciseStart.BindingContext = listExer as ListExercise;
                await Navigation.PushModalAsync(exerciseStart, true);
            }
        }
예제 #6
0
        private static void intExercise2()
        {
            Console.Write("Enter number1 :");
            int num1 = Convert.ToInt32(Console.ReadLine());

            Console.Write("Enter number2 :");
            int num2 = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine(ListExercise.max1020(num1, num2));
        }
        protected override void OnAppearing()
        {
            base.OnAppearing();
            listExercise = (ListExercise)BindingContext;
            Exercise exercise = listExercise.Exercises[listExercise.IndexExercise];

            image.Source      = exercise.ImageExercise;
            nameExercise.Text = exercise.NameExercise;
            repNumber.Text    = exercise.Time;
            Sound();
            Plugin.TextToSpeech.CrossTextToSpeech.Current.Speak($"you need exercise {repNumber.Text}  {nameExercise.Text}  ");
        }
예제 #8
0
        private static void intExercise5()
        {
            Console.WriteLine("Enter ages for Students");
            Console.Write("Student1:");
            int age1 = Convert.ToInt32(Console.ReadLine());

            Console.Write("Student2 :");
            int age2 = Convert.ToInt32(Console.ReadLine());

            Console.Write("Student3 :");
            int age3 = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine(ListExercise.HasTeen(age1, age2, age3));
        }
예제 #9
0
 private static void intExercise1()
 {
     try
     {
         Console.WriteLine("Enter 1st number");
         int num1 = Convert.ToInt32(Console.ReadLine());
         Console.WriteLine("Enter 2nd number");
         int num2 = Convert.ToInt32(Console.ReadLine());
         Console.WriteLine(ListExercise.In3050(num1, num2) ? "yes in range" : "no not");
     }
     catch (FormatException ex)
     {
         Console.WriteLine("Input must be a number : " + ex.Message);
     }
 }
예제 #10
0
 private static void boolExercise3()
 {
     try
     {
         Console.WriteLine("Is monkey A smiling? true or false");
         bool asmiling = Convert.ToBoolean(Console.ReadLine());
         Console.WriteLine("Is monkey B smiling? true or false");
         bool bsmiling = Convert.ToBoolean(Console.ReadLine());
         Console.Write("Are we in trouble ? :" + (ListExercise.InTrouble(asmiling, bsmiling) ? "Yes" : "No"));
     }
     catch (FormatException ex)
     {
         Console.WriteLine("Input must be true or false : " + ex.Message);
     }
     finally { Console.Read(); }
 }
예제 #11
0
 private static void boolExercise2()
 {
     try
     {
         Console.WriteLine("Is it a week day? true or false");
         bool weekday = Convert.ToBoolean(Console.ReadLine());
         Console.WriteLine("Are you on Vacation? true or false");
         bool vacation = Convert.ToBoolean(Console.ReadLine());
         Console.Write("We sleep ? :" + (ListExercise.sleepin(weekday, vacation) ? "Yes" : "No"));
     }
     catch (FormatException ex)
     {
         Console.WriteLine("Input must be true or false :" + ex.Message);
     }
     finally { Console.Read(); }
 }
예제 #12
0
        private static void boolExercise1()
        {
            Console.WriteLine("Enter name");
            string userInput = Console.ReadLine();

            if (Validator.isvalidInputString(userInput))
            {
                var    result        = ListExercise.doesContainVowels(userInput);
                string outputMessage = result == true ? "Your Name have vowel" : "That's unique Name";
                Console.WriteLine(outputMessage);
            }
            else
            {
                Console.WriteLine("Input not correct");
            }
            //todo: ask again and run agan
        }
        async protected override void OnAppearing()
        {
            base.OnAppearing();
            i     = 20;
            value = -1;
            progressTime.Progress = 0;

            listExercise = (ListExercise)BindingContext;
            if (listExercise.IndexExercise < (listExercise.Exercises.Count - 1))
            {
                var index = listExercise.IndexExercise;
                NameExercise.Text = listExercise.Exercises[index + 1].NameExercise;
                TimeExercise.Text = listExercise.Exercises[index + 1].Time;

                Plugin.TextToSpeech.CrossTextToSpeech.Current.Speak($"the next : {TimeExercise.Text} {NameExercise.Text} ");
            }


            await progressTime.ProgressTo(1, 20000, Easing.Linear);
        }
예제 #14
0
 public void testIn3050()
 {
     Assert.AreEqual(ListExercise.In3050(30, 40), true);
     Assert.AreEqual(ListExercise.In3050(30, 41), false);
     Assert.AreEqual(ListExercise.In3050(40, 50), true);
 }
예제 #15
0
 public void testSum()
 {
     Assert.AreEqual(ListExercise.getFirstDuplicateChar("abbccde").Equals("Duplicate char is b"), true);
 }
예제 #16
0
        private static void stringExercise10()
        {
            var result = ListExercise.getFirstDuplicateChar("abcbdde");

            Console.WriteLine($"{result}");
        }
예제 #17
0
        private static void arrayExercise2()
        {
            int[] arrInt = new int[] { 1, 2, 9, 9, 3, 2, 9 };

            Console.WriteLine("Count of 9: " + ListExercise.arayCount9(arrInt));
        }
예제 #18
0
        private static void arrayExercise1()
        {
            int[] arrInt = new int[] { 1, 1, 2, 4, 1 };

            Console.WriteLine(ListExercise.Array123(arrInt));
        }
예제 #19
0
 public void TestInTrouble()
 {
     Assert.AreEqual(ListExercise.InTrouble(true, false), false);
     Assert.AreEqual(ListExercise.InTrouble(false, false), true);
     Assert.AreEqual(ListExercise.InTrouble(true, true), true);
 }