Standard Algorithms Input validation Finding the minimum

Slides:



Advertisements
Similar presentations
Standard Algorithms Find the highest number. ! Your name and today’s date ! Find the maximum Dim numbers(20) As Integer.
Advertisements

Analysis of Algorithms
Int 2 Multimedia Revision. Digitised Sound Analogue sound recorded from person, or real instruments.
CS102--Object Oriented Programming Discussion 2: (programming strategy in java) – Two types of tasks – The use of arrays Copyright © 2008 Xiaoyan Li.
Standard Algorithms. 4 Standard Algorithms Input Validation Finding the Maximum / Minimum Counting Occurrences Linear Search.
Standard Algorithms. Many algorithms appear over and over again, in program after program. These are called standard algorithms You are required to know.
BACS 287 Programming Logic 3. BACS 287 Iteration Constructs Iteration constructs are used when you want to execute a segment of code several times. In.
Designing Algorithms Csci 107 Lecture 3. Designing algorithms Last time –Pseudocode –Algorithm: computing the sum 1+2+…+n –Gauss formula for 1+2+…+n Today.
REPETITION STRUCTURES. Topics Introduction to Repetition Structures The while Loop: a Condition- Controlled Loop The for Loop: a Count-Controlled Loop.
Higher Grade Computing Studies 4. Standard Algorithms Higher Computing Software Development S. McCrossan 1 Linear Search This algorithm allows the programmer.
Standard Algorithms –search for an item in an array –count items in an array –find the largest (or smallest) item in an array.
Array Processing.
Traversing an array 1.Definition 2.Use the for loop 3.Some new functions 4.Use the while loop 1.
30/10/ Iteration Loops Do While (condition is true) … Loop.
04/11/ Arrays 1D Arrays Defining, Declaring & Processing.
Even more problems.. Mean (average) I need a program that calculates the average of student test scores. I need a program that calculates the average.
 There are times when you will want blocks to repeat. Instead of duplicating blocks and ending up with a long script that might be confusing, there.
Adding 10 items to a list… lstTest.Items.Add(1) lstTest.Items.Add(2) lstTest.Items.Add(3) lstTest.Items.Add(4) lstTest.Items.Add(5) lstTest.Items.Add(6)
Programming with Loops. When to Use a Loop  Whenever you have a repeated set of actions, you should consider using a loop.  For example, if you have.
Designing While Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Data Validation while loops. Data validation Programs get input data from different sources All data should be ‘validated’ before the program tries to.
Validation final steps Stopping gaps being entered in an input.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 5 Repetition Structures.
CSC 1010 Programming for All Lecture 4 Loops Some material based on material from Marty Stepp, Instructor, University of Washington.
 Software Development Life Cycle  Software Development Tools  High Level Programming:  Structures  Algorithms  Iteration  Pseudocode  Order of.
CHAPTER EIGHT ARRAYS © Prepared By: Razif Razali1.
Programming Problems Intermediate 2 Computing SHOW YOUR TEACHER YOUR WORKING PROGRAM AND WRITING FRAME THEN SAVE IN YOUR PROGRAMMING FOLDER AND UPDATE.
Escape sequence Certain characters, preceded by a backslash ( \ ), are known as escape sequences They are used to display certain characters, or as display.
Marr CollegeHigher Software DevelopmentSlide 1 Higher Computing Software Development Topic 4: Standard Algorithms.
GCSE COMPUTER SCIENCE Practical Programming using Python
NFIRS Data Entry Browser Interface (DEBI) nfirs. fema
Data Types Variables are used in programs to store items of data e.g a name, a high score, an exam mark. The data stored in a variable is entered from.
CHAPTER 6: REPETITION AND LOOP STATEMENTS
Searching – Linear and Binary Searches
Topics Introduction to Repetition Structures
Lecture – 2 on Data structures
Data Validation and Protecting Workbook
Lesson 05: Iterations Class Chat: Attendance: Participation
Chapter 5: Control Structure
Standard Algorithms Higher Computing.
Topics Introduction to Repetition Structures
Lecture 07 More Repetition Richard Gesick.
Starter Write a program that asks the user if it is raining today.
Iterations Programming Condition Controlled Loops (WHILE Loop)
CIS115 Education for Service-- snaptutorial.com
CIS 115 Teaching Effectively-- snaptutorial.com
Print slides for students reference
Control Structure Senior Lecturer
Control Structure Senior Lecturer
Arrays An Array is an ordered collection of variables
NFIRS Data Entry Browser Interface (DEBI) nfirs. fema
Lesson 05: Iterations Topic: Introduction to Programming, Zybook Ch 4, P4E Ch 5. Slides on website.
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Higher Computing Using Loops.
Do While (condition is true) … Loop
CPS125 Week
Chapter 7: Input Validation
AP Java 9/21/2018.
Part 6 Q26 to Q30 of National 5 Prelim
Topics Introduction to Repetition Structures
Arrays.
Binary Search Counting
Unit 2: Computational Thinking, Algorithms & Programming
GCSE Computing:: While Loops
Learning Intention I will learn about the standard algorithm for input validation.
Arrays & Loops.
Algorithms For use in Unit 2 Exam.
Arrays & Loops.
Iteration – While Loops
Presentation transcript:

Standard Algorithms Input validation Finding the minimum Finding the maximum Counting occurances Linear search

Input validation (numbers) DO (Start loop) Display message to ask for a number Get number from keyboard If number < 0 OR number > 100 then Error message End if Loop Until number = > 0 AND number<= 100

Input validation (strings) Set password to STOP DO (Start loop) Get guess from user If guess is not equal to password then error message End if Loop Until guess = password

Input validation Task task on page 130 of booklet 2

Standard Algorithms Input validation is the only Standard Algorithm that you need to be able to code. However you need to know about : Finding the minimum Finding the maximum Counting occurances Linear search

Finding Minimum Finding the lowest mark in a list of exam marks Finding the winner in a list of golf scores Finding the youngest member of a club

Finding Maximum Finding the highest score in an exam Finding the tallest person in a class Finding the most expensive item

Counting Occurences Find out how many times a certain name appears in a list Find out how many times a certain exam mark appears in a list

Linear Search Searching for a name in a list Searching for a number in a list