Objectives

Students will be able to:

Task 2

Task 2

You need to figure out how to make the form interactive. You have decided on this initial idea, presented as pseudocode in your Criterion C document:

if proof_of_identity checked then

count how many text boxes are blank

if count is zero then

display Registration complete

else

display error list

end if

else

display identity not checked

end if

Note how useful it can be to plan your solution in pseudocode before you start actual coding. This is an example of THINKING AHEAD!

Code this prototype. Here is a suggested video solution if required.

*note we are considering this a proptotype because it will give the user the look and feel of the form in action, but it does not yet deal with the file handling.

Task B

Data Validation

Data validation is when data entered into a system is checked for validity. The common checks are:

  • presence check - is data present? You have already coded this data validation check in Task A!
  • format check - does the data match a required format eg an email address needs 1 @ and at least one . (but not as the final character!)
  • length check - is the data of the required length? eg employee id numbers may be exactly 5 characters long
  • type check - is the data being entered of the correct type? eg you cannot enter the text character "d" into the age field of a form!

Mobile numbers in this country always start with 0 (format check) and are always exactly 9 characters long (length check).

Adapt your solution to display an appropriate error message if an invalid mobile number is entered.

Task C

Data Validation

A range check is necessary on the age field.

Only people who are 16 or older are allowed in the cafe.

Can you figure out how to test if a new member is less than 16 years old and display a warning message if this is true?

This task is optional...

... but a good test of your problem-solving skills!

Tags

iterative cycle client survey observe stakeholder


SUBSCRIBE

Join my mailing list to receive updates on the latest blog posts and other things.