Download presentation
Presentation is loading. Please wait.
1
7 - Programming 7J, K, L, M, N, O – Handling Data
2
Learning Intentions To develop an understanding of how data is stored and handled in algorithms
3
Assessment Outcomes 7J - Define the terms variable and constant as used in an imperative language 7K – Use variables and constants 7L – describe the data types integer, real, Boolean, character and string 7M – select and justify appropriate data types for a given program 7N – perform common operations on numeric and Boolean data 7O - Use one-dimensional arrays.
4
7J/K – Define the terms variables and constants
Constants are stored items of data that do not change as the program runs. For example when working out the area of a circle: Pi = 3.14 Radius = User input integer Area = Pi x (Radius x Radius) Print Area Variables are stored items of data that can change as the program runs. For example the current score in a game: Score = 0 If Player hits target: Score = Score + 10
5
7L/M – Data types Data Type Type of Data Use in a program Integer
A whole number, such as 3, 45,‐453 To input a users age, marks on a test, the day of the month. Real (Float) A number with a fractional part (decimal) such as 3.14, 9.5, 100.1 To set up Pi in a program String Zero or more characters that could include letters, punctuation, symbols, and numbers For storing names, filenames, user inputted answers. Char A single character, could include letters, punctuation, symbols, and numbers For storing single letters, choice ‘a’, ‘b’, ‘c’, etc. Boolean A boolean variable has the value True or False. Age verification checks.
6
7N - perform common operations on numeric and Boolean data
Numerical Data Data Type Operations Integer Arithmetic operations Comparison operations Real Arithmetic operations (but not DIV and MOD, which only apply to whole numbers) Boolean Logical operations Arithmetic operations Comparison operations eg: = 28 eg: 456 > 34 is true • + (addition) < (less than) ‐ (subtraction) > (greater than) * (multiplication) <= (less than or equal to) / (division) >= (greater than or equal to) DIV (integer division) <> (not equal to) MOD (modulus) = (equal to) Logical Operations: Not And Or
7
7O - Use one-dimensional arrays
Arrays are a data structure that stores multiple values of the same data type. For example the top scores in a video game: TopScores = [90, 80, 75, 60] The benefits of using arrays are: Code is easier to follow and therefore easier to debug and maintain. A group of data can be easily processed using a FOR loop. Arrays are addressed by counting from 0: TopScores = [90, 80, 75, 60] This means that each element can be addressed individually. print(TopScores[2]) This code would output ‘75’
8
Crib – Fundamental topics
Define Sequencing and give an example Define Selection and explain how it is achieved using: If, Elif, Else Case Define Iteration and give an example of how it is achieved using: For Loops While Loops Repeat Loops
9
Exam Questions I have ripped off every exam question for Unit 1 – Fundamentals of Computing.. Answer all of the questions in the A, B, C folder. Self Assess them all. Get me to check them!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.