SlideShare a Scribd company logo
Input Validation
Input Validation
Ensure that the data which the user has entered is within a
reasonable range
Program should repeatedly ask the user to re-enter until acceptable
data has been entered
Example:
A program ask the user to enter a month of the year in numeric
form
Acceptable data entries are 1,2,3,4,5,6,7,8,8,10,11,12
If the user enters any other data they should be asked to re-enter
Input Validation
Input Validation
What are the acceptable data ranges for the following:
Input Valid Entries
Day of the week in numeric form
A person’s age
A person’s sex
A lottery number
A pupil’s year group
A pupil’s tutor group
Input Validation
What are the acceptable data ranges for the following:
Input Valid Entries
Day of the week in numeric form 1 – 7
A person’s age 0 – 115
A person’s sex m, f, male, female
A lottery number 1 – 49
A pupil’s year group 1 – 6
A pupil’s tutor group Various solutions…
Input Validation
Input validation works well with simple numeric data, but what
about more complex entries?
Bank account number – program could check the correct
number of digits, and that all characters are numeric
Person’s name – program could ask the user if the entry is
correct (Y/N)
Where possible, programs can reduce errors by restricting
options using drop-down menu. But will this still be correct?
Pseudocode
The basic input validation pseudocode takes the following
form
Pseudocode – Exam Score
A program should ask the user to enter their exam score
Acceptable scores are 0-100
Code – Exam Score
A program should ask the user to enter their exam score
Acceptable scores are 0-100
Pseudocode – Multiple choice
A program should ask the user to enter the answer to a
multiple choice question: 1, 2 or 3
Pseudocode – Multiple choice
A program should ask the user to enter the answer to a
multiple choice question: 1, 2 or 3
Code – Multiple Choice
A program should ask the user to enter the answer to a
multiple choice question: 1, 2 or 3

More Related Content

What's hot

java 8 new features
java 8 new features java 8 new features
java 8 new features
Rohit Verma
 
File Handling
File HandlingFile Handling
File Handling
Forrester High School
 
Bluej
BluejBluej
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
arvind pandey
 
Angular Libraries & NPM
 Angular Libraries & NPM Angular Libraries & NPM
Angular Libraries & NPM
Knoldus Inc.
 
Angular data binding
Angular data binding Angular data binding
Angular data binding
Sultan Ahmed
 
Java 8-streams-collectors-patterns
Java 8-streams-collectors-patternsJava 8-streams-collectors-patterns
Java 8-streams-collectors-patterns
José Paumard
 
Clean Code: Chapter 3 Function
Clean Code: Chapter 3 FunctionClean Code: Chapter 3 Function
Clean Code: Chapter 3 Function
Kent Huang
 
CLASSIFICATION OF DEBUGGERS
CLASSIFICATION OF DEBUGGERSCLASSIFICATION OF DEBUGGERS
CLASSIFICATION OF DEBUGGERS
JAINAM KAPADIYA
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Yi-Fan Chu
 
N5 Computing Science Structure Diagrams
N5 Computing Science Structure DiagramsN5 Computing Science Structure Diagrams
N5 Computing Science Structure Diagrams
Forrester High School
 
Polymorphism in C++
Polymorphism in C++Polymorphism in C++
Polymorphism in C++
Rabin BK
 
09. Java Methods
09. Java Methods09. Java Methods
09. Java Methods
Intro C# Book
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
Nilesh Dalvi
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
Mohammed Sikander
 
spring-api-rest.pdf
spring-api-rest.pdfspring-api-rest.pdf
spring-api-rest.pdf
Jaouad Assabbour
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Sandeep Kumar Singh
 
functions of C++
functions of C++functions of C++
functions of C++
tarandeep_kaur
 
CIS110 Computer Programming Design Chapter (1)
CIS110 Computer Programming Design Chapter  (1)CIS110 Computer Programming Design Chapter  (1)
CIS110 Computer Programming Design Chapter (1)
Dr. Ahmed Al Zaidy
 

What's hot (20)

java 8 new features
java 8 new features java 8 new features
java 8 new features
 
File Handling
File HandlingFile Handling
File Handling
 
Bluej
BluejBluej
Bluej
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
 
Angular Libraries & NPM
 Angular Libraries & NPM Angular Libraries & NPM
Angular Libraries & NPM
 
Angular data binding
Angular data binding Angular data binding
Angular data binding
 
Java 8-streams-collectors-patterns
Java 8-streams-collectors-patternsJava 8-streams-collectors-patterns
Java 8-streams-collectors-patterns
 
Clean Code: Chapter 3 Function
Clean Code: Chapter 3 FunctionClean Code: Chapter 3 Function
Clean Code: Chapter 3 Function
 
CLASSIFICATION OF DEBUGGERS
CLASSIFICATION OF DEBUGGERSCLASSIFICATION OF DEBUGGERS
CLASSIFICATION OF DEBUGGERS
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
N5 Computing Science Structure Diagrams
N5 Computing Science Structure DiagramsN5 Computing Science Structure Diagrams
N5 Computing Science Structure Diagrams
 
Polymorphism in C++
Polymorphism in C++Polymorphism in C++
Polymorphism in C++
 
09. Java Methods
09. Java Methods09. Java Methods
09. Java Methods
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Strings in Java
Strings in JavaStrings in Java
Strings in Java
 
spring-api-rest.pdf
spring-api-rest.pdfspring-api-rest.pdf
spring-api-rest.pdf
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
functions of C++
functions of C++functions of C++
functions of C++
 
CIS110 Computer Programming Design Chapter (1)
CIS110 Computer Programming Design Chapter  (1)CIS110 Computer Programming Design Chapter  (1)
CIS110 Computer Programming Design Chapter (1)
 

Similar to SD & D Input Validation

White Label E-learning Platform
White Label E-learning PlatformWhite Label E-learning Platform
White Label E-learning Platform
Onestep info system Pvt Ltd.
 
If switch structure
If switch structureIf switch structure
If switch structure
M Sagheer Malik
 
Java Practice Set
Java Practice SetJava Practice Set
Java Practice Set
Gaurav Dixit
 
Generic polling pres.
Generic polling pres.Generic polling pres.
Generic polling pres.Mike Walsh
 
Statistics and probability lesson 4
Statistics and probability lesson 4Statistics and probability lesson 4
Statistics and probability lesson 4
MARIA CHRISTITA POLINAG
 
Field Recruitment Skills Testing Brochure
Field Recruitment Skills Testing BrochureField Recruitment Skills Testing Brochure
Field Recruitment Skills Testing Brochure
Andrew Wright CertRP
 
Web version polling
Web version pollingWeb version polling
Web version pollingMike Walsh
 
Build accurate assessment with question analytics
Build accurate assessment with question analyticsBuild accurate assessment with question analytics
Build accurate assessment with question analytics
HackerEarth
 
Determination of the effectiveness of aptitude test to improve sincerity in th
Determination of the effectiveness of aptitude test to improve sincerity in thDetermination of the effectiveness of aptitude test to improve sincerity in th
Determination of the effectiveness of aptitude test to improve sincerity in thIAEME Publication
 
Data analysis market research
Data analysis   market researchData analysis   market research
Data analysis market research
sachinudepurkar
 
HIPAA secure text messaging - miSecureMessages
HIPAA secure text messaging - miSecureMessagesHIPAA secure text messaging - miSecureMessages
HIPAA secure text messaging - miSecureMessages
AMTELCO
 
Presentation1
Presentation1Presentation1
Presentation1girlie22
 
AcceptCriteria_TestCases_TestScripts
AcceptCriteria_TestCases_TestScriptsAcceptCriteria_TestCases_TestScripts
AcceptCriteria_TestCases_TestScriptsRussell Pannone
 
SD & D analysis
SD & D analysisSD & D analysis
SD & D analysis
Forrester High School
 
IDS Credential 2016
IDS Credential 2016IDS Credential 2016
IDS Credential 2016Manas Mishra
 
Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7comp274
 

Similar to SD & D Input Validation (20)

White Label E-learning Platform
White Label E-learning PlatformWhite Label E-learning Platform
White Label E-learning Platform
 
If switch structure
If switch structureIf switch structure
If switch structure
 
Java Practice Set
Java Practice SetJava Practice Set
Java Practice Set
 
Generic polling pres.
Generic polling pres.Generic polling pres.
Generic polling pres.
 
Statistics and probability lesson 4
Statistics and probability lesson 4Statistics and probability lesson 4
Statistics and probability lesson 4
 
Field Recruitment Skills Testing Brochure
Field Recruitment Skills Testing BrochureField Recruitment Skills Testing Brochure
Field Recruitment Skills Testing Brochure
 
Web version polling
Web version pollingWeb version polling
Web version polling
 
Build accurate assessment with question analytics
Build accurate assessment with question analyticsBuild accurate assessment with question analytics
Build accurate assessment with question analytics
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
Determination of the effectiveness of aptitude test to improve sincerity in th
Determination of the effectiveness of aptitude test to improve sincerity in thDetermination of the effectiveness of aptitude test to improve sincerity in th
Determination of the effectiveness of aptitude test to improve sincerity in th
 
Data analysis market research
Data analysis   market researchData analysis   market research
Data analysis market research
 
SWQ
SWQSWQ
SWQ
 
HIPAA secure text messaging - miSecureMessages
HIPAA secure text messaging - miSecureMessagesHIPAA secure text messaging - miSecureMessages
HIPAA secure text messaging - miSecureMessages
 
Presentation1
Presentation1Presentation1
Presentation1
 
AcceptCriteria_TestCases_TestScripts
AcceptCriteria_TestCases_TestScriptsAcceptCriteria_TestCases_TestScripts
AcceptCriteria_TestCases_TestScripts
 
IIT App (1)
IIT App (1)IIT App (1)
IIT App (1)
 
SD & D analysis
SD & D analysisSD & D analysis
SD & D analysis
 
IDS Credential 2016
IDS Credential 2016IDS Credential 2016
IDS Credential 2016
 
Resume
ResumeResume
Resume
 
Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7Cis 115 i lab 4 of 7
Cis 115 i lab 4 of 7
 

More from Forrester High School

Program Design
Program DesignProgram Design
Program Design
Forrester High School
 
Database Evaluation
Database EvaluationDatabase Evaluation
Database Evaluation
Forrester High School
 
Testing SQL
Testing SQLTesting SQL
SQL
SQLSQL
Database Query Design
Database Query DesignDatabase Query Design
Database Query Design
Forrester High School
 
Data Dictionary
Data DictionaryData Dictionary
Data Dictionary
Forrester High School
 
Compound Keys
Compound KeysCompound Keys
Compound Keys
Forrester High School
 
Entity Occurrence Diagrams
Entity Occurrence DiagramsEntity Occurrence Diagrams
Entity Occurrence Diagrams
Forrester High School
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
Forrester High School
 
Database Analysis
Database AnalysisDatabase Analysis
Database Analysis
Forrester High School
 
Software Evaluation
Software EvaluationSoftware Evaluation
Software Evaluation
Forrester High School
 
Software Testing
Software TestingSoftware Testing
Software Testing
Forrester High School
 
Python Predefined Functions
Python Predefined FunctionsPython Predefined Functions
Python Predefined Functions
Forrester High School
 
Python Substrings
Python SubstringsPython Substrings
Python Substrings
Forrester High School
 
Variable Scope
Variable ScopeVariable Scope
Variable Scope
Forrester High School
 
Records in Python
Records in PythonRecords in Python
Records in Python
Forrester High School
 
Parallel arrays in python
Parallel arrays in pythonParallel arrays in python
Parallel arrays in python
Forrester High School
 
SDD Predefined Functions
SDD Predefined FunctionsSDD Predefined Functions
SDD Predefined Functions
Forrester High School
 
SDD Cconditional Loops
SDD Cconditional LoopsSDD Cconditional Loops
SDD Cconditional Loops
Forrester High School
 
SDD Fixed Loops
SDD Fixed LoopsSDD Fixed Loops
SDD Fixed Loops
Forrester High School
 

More from Forrester High School (20)

Program Design
Program DesignProgram Design
Program Design
 
Database Evaluation
Database EvaluationDatabase Evaluation
Database Evaluation
 
Testing SQL
Testing SQLTesting SQL
Testing SQL
 
SQL
SQLSQL
SQL
 
Database Query Design
Database Query DesignDatabase Query Design
Database Query Design
 
Data Dictionary
Data DictionaryData Dictionary
Data Dictionary
 
Compound Keys
Compound KeysCompound Keys
Compound Keys
 
Entity Occurrence Diagrams
Entity Occurrence DiagramsEntity Occurrence Diagrams
Entity Occurrence Diagrams
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
Database Analysis
Database AnalysisDatabase Analysis
Database Analysis
 
Software Evaluation
Software EvaluationSoftware Evaluation
Software Evaluation
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Python Predefined Functions
Python Predefined FunctionsPython Predefined Functions
Python Predefined Functions
 
Python Substrings
Python SubstringsPython Substrings
Python Substrings
 
Variable Scope
Variable ScopeVariable Scope
Variable Scope
 
Records in Python
Records in PythonRecords in Python
Records in Python
 
Parallel arrays in python
Parallel arrays in pythonParallel arrays in python
Parallel arrays in python
 
SDD Predefined Functions
SDD Predefined FunctionsSDD Predefined Functions
SDD Predefined Functions
 
SDD Cconditional Loops
SDD Cconditional LoopsSDD Cconditional Loops
SDD Cconditional Loops
 
SDD Fixed Loops
SDD Fixed LoopsSDD Fixed Loops
SDD Fixed Loops
 

Recently uploaded

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 

Recently uploaded (20)

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 

SD & D Input Validation

  • 2. Input Validation Ensure that the data which the user has entered is within a reasonable range Program should repeatedly ask the user to re-enter until acceptable data has been entered Example: A program ask the user to enter a month of the year in numeric form Acceptable data entries are 1,2,3,4,5,6,7,8,8,10,11,12 If the user enters any other data they should be asked to re-enter
  • 4. Input Validation What are the acceptable data ranges for the following: Input Valid Entries Day of the week in numeric form A person’s age A person’s sex A lottery number A pupil’s year group A pupil’s tutor group
  • 5. Input Validation What are the acceptable data ranges for the following: Input Valid Entries Day of the week in numeric form 1 – 7 A person’s age 0 – 115 A person’s sex m, f, male, female A lottery number 1 – 49 A pupil’s year group 1 – 6 A pupil’s tutor group Various solutions…
  • 6. Input Validation Input validation works well with simple numeric data, but what about more complex entries? Bank account number – program could check the correct number of digits, and that all characters are numeric Person’s name – program could ask the user if the entry is correct (Y/N) Where possible, programs can reduce errors by restricting options using drop-down menu. But will this still be correct?
  • 7. Pseudocode The basic input validation pseudocode takes the following form
  • 8. Pseudocode – Exam Score A program should ask the user to enter their exam score Acceptable scores are 0-100
  • 9. Code – Exam Score A program should ask the user to enter their exam score Acceptable scores are 0-100
  • 10. Pseudocode – Multiple choice A program should ask the user to enter the answer to a multiple choice question: 1, 2 or 3
  • 11. Pseudocode – Multiple choice A program should ask the user to enter the answer to a multiple choice question: 1, 2 or 3
  • 12. Code – Multiple Choice A program should ask the user to enter the answer to a multiple choice question: 1, 2 or 3