BTEC COMPUTING UNIT 1 SECTION B FLOWCHARTS SECTION
BTEC COMPUTING – UNIT 1 SECTION B - FLOWCHARTS SECTION A – COMPUTATIONAL THINKING DECOMPOSITION – PATTERN RECOGNITION – ABSTRACTION – ALGORITHM DESIGN - SECTION C – PROGRAMMING PARADIGMS Mathematical Operators Comparison Operators + == - > * < / <> or != MOD >= DIV <= ^ SECTION C – PROGRAMMING PARADIGMS What is a Variable? Pseudocode: Lists [arrays] Creating A List What is a Constant? Data Types: String Integer Float/Real Boolean Casting: Changing the variable from one data type to another. str(3) or int(“ 3”) While Loop [based on a condition] count = 0 while count < 100: output(count) count = count + 1 names[1] this would output Alex Looping Through A List for i in name: output names[i] Length Of A List Output (len(names) Using A Loop To Count The Value Of Items In A List scores = [5, 12, 5, 7, 8] total = 0 for i in scores: total = total + i Length Of A String Pseudocode: Functions[returns a value] Getting A Sub String (Part Of The String) Name of function Change String To Upper Case for i = 1 to 100: output (i) Getting An Item From A List Pseudocode: String Handling Pseudocode: Iteration For Loop [you know how many times you want to loop names = [“Bob”, “Alex”, “Chris”] function triple (number) return number*3 end function Change String To Lower Case Pseudocode: Selection Pseudocode: Basic if entry == "a" then print("You selected A") elseif entry=="b" then print("You selected B") else print("Unrecognised selection") endif name = input (“What is your name”) Pseudocode: Files Opening A File Reading From A File output (name) or joining a string and variable together output (“your name is: ” + name) Writing To A File Parameters (values sent for function to use) my. File = open(“computing. txt”) my. File = open. Read(“computing. txt”) while NOT my. File. end. Of. File() print(my. File. read. Line()) endwhile my. File. close() my. File = open. Write(“sample. txt”) my. File. write. Line(“Hello World”) my. File. close() Call the Function by using its name and send any parameters in brackets. E. g. : y=triple(7)
BTEC COMPUTING – UNIT 1 SECTION C – PROGRAMMING PARADIGMS Bubble Sort Quick Sort Insertion Sort How it operates Advantages Disadvantages SECTION C – VALIDATION Binary Search Linear Search How it operates What is input validation? How it operates Validation technique Advantages Disadvantages SECTION C – STACKS AND QUEUES Post Check Actions Used for
- Slides: 2