Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure inputNumber(op : integer);
- var number : string;
- i, chDig : integer;
- isValid : Boolean;
- begin
- //Input your code here for the inputNumber procedure
- if op = 1 then
- repeat
- writeln('Enter The 12 Digit Number You Want A Check Digit Created For:');
- readln(number);
- if length(number) = 12 then
- getCheckDigit(number,chDig)
- else
- writeln('Invalid Entry');
- until length(number) = 12;
- end;
- procedure getOption;
- var optionStr : string;
- option : integer;
- begin
- //Input your code here for the getOption procedure
- repeat
- writeln('(1) Create A Check Digit For A 12 Digit Number');
- writeln('(2) Have A 13 Digit Number Checked To See If The Check Digit Is Valid');
- writeln('Enter A Number For Either Of The Options Above:');
- readln(option);
- if (option < 1) OR (option > 2) then
- writeln('Invald Option')
- until (option = 1) OR (option = 2);
- if option = 1 then
- inputNumber(option)
- else if option = 2 then
- inputNumber(option);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement