Computing
Computer Science LearnITWithMrC ⛯ Year 7 Year 8 Year 9 GCSE
Responsive image

Lesson Video

30

Lesson Tasks

  • Watch the Lesson video
    Make notes if needed.
  • Open your Learning Journal
    Complete Task 1 in your Learning Journal
  • Complete the learning activities
    Make sure you complete the book tasks in your Unit Booklet
  • Complete End of Task Assessment
    Update your learning objectives

What do I need to Learn?

0 results forGuest
I need to learn how to explain what data validation is.

Key Terms

validation validation checks Verification Type check Format check Length check Presence check Range check Lookup check Check digit

There is no Powerpoint to go with this section. You can download the notes sheet from Task 1 and make some notes on the topic, however most tasks are to be completed in your book. Don't forget to update your learning objectives at the end!

Task 1 - Getting organised - notes Click to see more


Task 1: Fill in the heading.

Open your cornell notes word document, if you would rather fill it in by hand then feel free to print it out. Fill in the video title and the topic at the top of the page. See example below.

Open a Cornell notes sheet by clicking on the image below.

Avatar

Remember good notes allow students to help each other problem solve

Good notes will help you organise and process data and information

Cornell notes help you retain and recall information by having three different ways/sections where you process the information.

Note taking is a way of helping you to remember things you would otherwise forget. It also stimulates our critical thinking skills.

Remember! whenever you see the notes icon this means the information is important and you should write it down on your notes sheet.


Task 2 - Data Validation Click to see more

Task: Data Validation

Open your student workbook at page 77 Read through the notes and complete the following tasks.
  1. Task 44
  2. Task 45
  3. Task 46


Task 3 - Try and Catch Click to see more

Task: try and Catch

Open your student workbook at page 80 Read through the notes and complete the following task.
  1. Copy the simple try and catch python code on the page to see how you can prevent your programming from crashing due to incorrect input from the user
  2. Investigate other errors you can catch to prevent your program from crashing


Task 4 - Extension Activities Click to see more

Data Validation - Learning Activities


Database validation is a process where the data entered in the database is checked to make sure that it is correct. The purpose of validation is to make sure that data is logical, rational, complete and within acceptable limits.

There are a range of validation methods like range check, type check etc. (see table in notes for more details)

A range check is probably the simplest validation method to understand. We give the user a range of values that are valid to enter then check they have entered a value in that range.

For example we could ask the user to enter a number between 1 and 10. Our validation routine would then check if the value entered was in that range. If the user entered say the number 11 our code should declare the value 'invalid' and ask the user to enter another value


Range Check – generally used when working with data which contains numbers, currency or date and time.

A range check lets you set appropriate limits:

Boundary Description Validation
Upper limit The maximum value is 10. <=10
Lower limit The minimum value is 1. >=1
A range Number entered must be less than or equal to 10 but greater than or equal to 1. >=1 and <=10

Data Validation in practice

I have coded the simple example above using a function called data validation. Run the code and check that it works.

Coding activity

Task 1: Range Check

Write some code that asks the uset to enter their age and checks if they are older than 11 and younger than 19.


Task 2: Length check

Write some code that asks the user to enter their phone number and checks if it is 12 digits or less.


Task 3: Verification

Write some code that asks the user to enter their password twice and checks that both entries are the same


Learning Outcomes

  • I can explain what validation and verification is.
  • I can create code to validate some data.
  • I can create code to validate and verify data
    using a range of different methods

Task 5 - Homework Click to see more


Complete any unfinished tasks