static TrainingProcess SportResult()
        {
            Console.WriteLine("Please enter the name of the sportsman");
            string sportsmanName = Console.ReadLine();

            Console.WriteLine("Please enter the total distance that the sportsman should overcome");
            double finalDistance = Hometask_2Library.HW2Library.InValidation(Console.ReadLine());

            Console.WriteLine("Please enter the value of the distance that the sportsman overcame on the first day");
            double firstDay = Hometask_2Library.HW2Library.InValidation(Console.ReadLine());

            Console.WriteLine("Please enter the number of percent the athlete's performance increased in comparison to the previous day");
            double progressPerDay = Hometask_2Library.HW2Library.InValidation(Console.ReadLine());

            var result = new TrainingProcess(firstDay, progressPerDay, finalDistance, sportsmanName);

            // Console.WriteLine("Start again? y/n");
            // if (Console.ReadKey(true).Key != ConsoleKey.Y)

            return(result);
        }
示例#2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Missclicks  = 0;
            CharCounter = 0;

            label13.Text = "none";
            label17.Text = "none";
            label19.Text = "none";


            Graphics Graph;
            Font     font = new Font("Sans Serif", Properties.Settings.Default.TextSize);

            Graph = splitContainer1.Panel1.CreateGraphics();

            //x=1 y=30

            TrainingProcess trainingProcess = new TrainingProcess();

            Result = trainingProcess.GetText();

            if (Properties.Settings.Default.IsRegisterEnabled == false)
            {
                Result = Result.ToLower();
            }

            Graph.DrawString(Result, font, Brushes.Black, 1, 30);

            if (Result == "File not found!" || Result == "file not found!")
            {
                trainingProcess.Timer(3);
                Application.Exit();
            }

            button3.Enabled = false;
            button4.Enabled = true;
            IfStarted       = true;
        }