Advertisement
MaoChessy

Task 5

Oct 22nd, 2020 (edited)
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 KB | None | 0 0
  1. using System;
  2.  
  3. namespace C_sharp_Light
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.            
  10.             uint peopleInQueue;
  11.             uint TimeReceptionPerson = 10;
  12.  
  13.         start:
  14.             Console.WriteLine("Программа для расчета времени ожидания в очереди.\n");
  15.             Console.Write("Сколько людей вы видите? Людей - ");
  16.             if(!uint.TryParse(Console.ReadLine(), out peopleInQueue))
  17.             {
  18.                 ErrorInvalidInput("Ошибка. Попробуйте ещё раз ввести количество людей.");
  19.                 goto start;
  20.             }
  21.  
  22.            
  23.             Console.WriteLine($"\nВ очереди {peopleInQueue} людей.\n" +
  24.                 $"Вы будете ждать своей очереди {peopleInQueue * TimeReceptionPerson/60} часа и {peopleInQueue * TimeReceptionPerson % 60} минут") ;
  25.             Console.ReadKey();
  26.            
  27.         }
  28.  
  29.         static private void ErrorInvalidInput(string textError)
  30.         {
  31.             Console.WriteLine(textError);
  32.             Console.ReadKey();
  33.             Console.Clear();
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement