Professional Documents
Culture Documents
Validation
Study the following line of code which asks the user to enter a test score in the range 0-100.
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
Page 1
Craig’n’Dave
Refine an algorithm | Validation 2
Validation
Study the following line of code which asks the user to enter a 4-digit product code which must start
with the capital letter “G” followed by any three numbers or characters.
print = ("Product codes must start with a capital G followed by any three
numbers or letters")
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
Page 1
Craig’n’Dave
Refine an algorithm | Validation 2
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
…………………………………………………………………………………………………………………………………………………………….
Page 2
Craig’n’Dave