Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. procedure inputNumber(op : integer);
  2. var number : string;
  3. i, chDig : integer;
  4. isValid : Boolean;
  5. begin
  6. //Input your code here for the inputNumber procedure
  7. if op = 1 then
  8. repeat
  9. writeln('Enter The 12 Digit Number You Want A Check Digit Created For:');
  10. readln(number);
  11. if length(number) = 12 then
  12. getCheckDigit(number,chDig)
  13. else
  14. writeln('Invalid Entry');
  15. until length(number) = 12;
  16. end;
  17.  
  18. procedure getOption;
  19. var optionStr : string;
  20. option : integer;
  21. begin
  22. //Input your code here for the getOption procedure
  23. repeat
  24. writeln('(1) Create A Check Digit For A 12 Digit Number');
  25. writeln('(2) Have A 13 Digit Number Checked To See If The Check Digit Is Valid');
  26. writeln('Enter A Number For Either Of The Options Above:');
  27. readln(option);
  28. if (option < 1) OR (option > 2) then
  29. writeln('Invald Option')
  30. until (option = 1) OR (option = 2);
  31. if option = 1 then
  32. inputNumber(option)
  33. else if option = 2 then
  34. inputNumber(option);
  35.  
  36. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement