SHARE
TWEET

Untitled

a guest Sep 17th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program Project1;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6.  
  7. SysUtils;
  8.  
  9. var
  10.  
  11. Day:byte;
  12.  
  13. IsCorrect:boolean;
  14.  
  15. begin
  16.  
  17. WriteLn('This program defines the day of week by entering numbers 1..7');
  18.  
  19. repeat
  20.  
  21. try
  22.  
  23. IsCorrect := True;
  24.  
  25. ReadLn(Day);
  26.  
  27. if (Day < 1) or (Day > 7) then
  28.  
  29. begin
  30.  
  31. IsCorrect := False;
  32.  
  33. WriteLn('Wrong number');
  34.  
  35. end;
  36.  
  37. except
  38.  
  39. IsCorrect := False;
  40.  
  41. WriteLn('Check entered data');
  42.  
  43. end;
  44.  
  45. until IsCorrect;
  46.  
  47. case Day of
  48.  
  49. 1:WriteLn('This day is Monday');
  50.  
  51. 2:WriteLn('This day is Tuesday');
  52.  
  53. 3:WriteLn('This day is Wednesday');
  54.  
  55. 4:WriteLn('This day is Thursday');
  56.  
  57. 5:WriteLn('This day is Friday');
  58.  
  59. 6:WriteLn('This day is Saturday');
  60.  
  61. 7:WriteLn('This day is Sunday');
  62.  
  63. end;
  64.  
  65. ReadLn;
  66.  
  67. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top