Flow Chart
Flow Chart
Algorithm
1. Start
2. Prompt the user to enter a ticket number
3. Read the ticket number from the user
4. Calculate the length of the ticket number
5. Check if the length of the ticket number is between 10 and 12
6. If the length of the ticket number is not between 10 and 12, then print an error message and go
to step 2
7. Drop the last digit of the ticket number
8. Convert the remaining ticket number to an integer
9. Divide the remaining ticket number by 7
10. Calculate the remainder of the division
11. Check if the remainder of the division is equal to the last digit of the ticket number
12. If the remainder of the division is not equal to the last digit of the ticket number, then print an
error message and go to step 2
13. Print a message indicating that the ticket number is valid
14. End
2. Pseudo-code
start
prompt the user to enter a ticket number
read the ticket number from the user
calculate the length of the ticket number
if the length of the ticket number is not between 10 and 12
print an error message
go to step 2
drop the last digit of the ticket number
convert the remaining ticket number to an integer
divide the remaining ticket number by 7
calculate the remainder of the division
if the remainder of the division is not equal to the last digit of the ticket number
print an error message
go to step 2
print a message indicating that the ticket number is valid
end
3. Flow chart
4. Hand-trace test results