Advertisement
MaoChessy

Task 5 fix

Oct 22nd, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.             while (true)
  14.             {
  15.                 Console.WriteLine("Программа для расчета времени ожидания в очереди.\n");
  16.                 Console.Write("Сколько людей вы видите? Людей - ");
  17.                 if (!uint.TryParse(Console.ReadLine(), out peopleInQueue))
  18.                 {
  19.                     Console.WriteLine("Ошибка.Попробуйте ещё раз ввести количество людей.");
  20.                     Console.ReadKey();
  21.                     Console.Clear();
  22.                     continue;
  23.                 }
  24.                 break;
  25.             }
  26.  
  27.             uint hours = peopleInQueue * timeReceptionPerson / 60;
  28.             uint minute = peopleInQueue * timeReceptionPerson % 60;
  29.             Console.WriteLine($"\nВ очереди {peopleInQueue} людей.\n" +
  30.                 $"Вы будете ждать своей очереди {hours} часа и {minute} минут");
  31.             Console.ReadKey();
  32.            
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement