Year 9 Computer Science Independent Learning Revision PDF
Document Details
Uploaded by LongLastingPulsar
Forest School
Tags
Summary
This document is a revision guide for Year 9 computer science, covering various topics like data representation, computational thinking, and programming concepts.
Full Transcript
## Year 9 Computer Science Independent Learning Revision | Homework | Set | Due wb | Task | |---|---|---|---| | 1 | 18th Nov | 25th Nov | Data Representation | | 2 | 25th Nov | 2nd Dec | Computational thinking | | 3 | 2nd Dec | 9th Dec | Spreadsheets - Teach-ICT Computer Science - Excel video tutor...
## Year 9 Computer Science Independent Learning Revision | Homework | Set | Due wb | Task | |---|---|---|---| | 1 | 18th Nov | 25th Nov | Data Representation | | 2 | 25th Nov | 2nd Dec | Computational thinking | | 3 | 2nd Dec | 9th Dec | Spreadsheets - Teach-ICT Computer Science - Excel video tutorials | | 4 | 9th Dec | 16th Dec | Use these tutorials to practice/revise | | 5 | 16th Dec | 7th Jan | Python programming and Algorithms | | | | | Flowchart and pseudocode | ## Year 9 Computer Science January 2025 Exam ### Unit/Topic: 7.3 Spreadsheet * Understand basic formula/functions for example using the operations SUM * Understand how to use more advanced functions COUNT & COUNTIF * Understand how to use AVERAG, MAX and MIN ### Unit/Topic: 8.1 Hardware * Understand what a computer is and how they can come in various forms. * Understand how computers receive commands and data * Understand what 'processing' means * Understand how computers can output information * Understand how it processes inputs to produce outputs * Understand that a computer is made up of a range of components. Understand the purpose / function of these components * Understand their relative importance * Understand the role of the CPU, RAM and Hard Drive * Understand how the CPU, RAM and Hard Drive work together. * Understand how the input and output devices work with the CPU * Understand what the CPU is, how it works and how its performance is measured ### Unit/Topic: 8.2 Data Representation * Understand how to convert denary to binary * Understand how to convert binary to denary * Understand how to Add in binary * Understand how to convert binary to ASCII * Understand how to convert binary to Hex * Understand how an image is represented in a computer * Understand how to Convert binary numbers to images * Understand how computers represent sound waves ### Unit/Topic: 8.5 Computer Crime and Cyber Security This unit covers some of the legal safeguards regarding computer understand Computer Misuse Act, Understand Data Protection Act and Copyright Law and their implications for computer use. Phishing scams and other email frauds, hacking, identity theft and safe use of social media ### Unit/Topic: 9.1 Algorithms * Understand decomposition * Understand pattern recognition * Understand abstraction * Understand pseudocode * Understand flowchart ### Unit/Topic: 9.2 Python Coding * Understand how to gather response from the user (input) * Understand how to use variables for input * Understand how to use strings to enter data * Understand how to use int to enter data * Understand and use the print command * Understand and use selection (if) * Understand and use iteration (for ands while loops) * Be able to write a simple program - such as accept 2 numbers, add the numbers and display result ## Year 7 Knowledge Recap ### Task 1: Place the following numbers into size order from smallest to largest 1. 1 Bit 2. 1 binary digit 3. 1 Byte 4. 8 bits 5. 1 Megabyte 6. 1,024 Kilobytes 7. 1 Kilobyte 8. 1 Nibble 9. 1,024 bytes 10. 4 bits 11. 1,048,576 bytes 12. 1 Gigabyte 13. 1,024 Megabytes 14. 1,073,741,824 bytes ### Task 2: Convert the binary numbers below into denary | Binary | Place Value | Denary | |---|---|---| | 1 | 128 | 1 | | 0 | 64 | 0 | | 1 | 32 | 32 | | 1 | 16 | 16 | | 0 | 8 | 0 | | 1 | 4 | 4 | | 0 | 2 | 0 | | 0 | 1 | 0 | | 82 | | 82 | | 0 | 128 | 0 | | 1 | 64 | 64 | | 0 | 32 | 0 | | 1 | 16 | 16 | | 1 | 8 | 8 | | 0 | 4 | 0 | | 1 | 2 | 2 | | 1 | 1 | 1 | | 91 | | 91 | ### Task 3: Convert the denary numbers below into binary | Denary | Place Value | Binary | |---|---|---| | 200 | 128 | 1 | | 200 | 64 | 1 | | 200 | 32 | 0 | | 200 | 16 | 1 | | 200 | 8 | 0 | | 200 | 4 | 0 | | 200 | 2 | 0 | | 200 | 1 | 0 | | 11001000 | | | | Denary | Place Value | Binary | |---|---|---| | | 240 | 128 | 1 | | 240 | 64 | 1 | | 240 | 32 | 1 | | 240 | 16 | 1 | | 240 | 8 | 0 | | 240 | 4 | 0 | | 240 | 2 | 0 | | 240 | 1 | 0 | | 11110000 | | | ## Binary Addition When performing binary addition with two binary numbers, the following calculations are used - 0+ 0 = 0 - 0 + 1 = 1(1) - 1 + 1 = 10(2) - 1 + 1 + 1 = 11(3) ### Task 1: Use binary addition to add the following binary nibbles | | Carry | Answer | |---|---|---| | 0111 | | 1010 | | + | | | | 0 1 0 1 | | | | 0110 | | 1101 | | + | | | | 0001 | | | | 1011 | | | | + | | | | 0111 | | | | 0110 | | 1101 | | + | | | | 0011 | | | ### Task 2: Use binary addition to add the following binary bytes | | Carry | Answer | |---|---|---| | 01101011| | | | + | | | | 00111010 | | | | 01010101 | | | | + | | | | 00111110 | | | | 01010101 | | | | + | | | | 01010111 | | | | 01110010 | | | | + | | | | 01111100 | | | ## How are Images Created? Example: A graphic designer wants to create a simple stickman graphic with the resolution of 10 x 10 (10 pixels in width, 10 pixels in height). The image can be created using black and white. As it only uses two colours, the colour depth is only 1 bit per pixel (represented as 0 for black or 1 for white). This resolution and colour depth information is stored in the image as metadata which is used by the computer to output the image correctly. ### Task 1: Follow the binary code below to create an image in the 15 x 16 grid to the right. 1 = White, 0 = Black 00001111111111111111111 11111111111111111111111 11111111111111111111111 11000001111111111111111 00111111111111111111111 11111111111111111111111 01111111111111111111111 11111100011111111111111 11111100011111111111111 11000000000001111111111 11011111111101111111111 11010011100101111111111 11010011100101111111111 11011111111101111111111 11011111111101111111111 11000000000001111111111 11111101011111111111111 11111101011111111111111 11111101011111111111111 11111000001111111111111 ## Colour Depth and Resolution ### Task 1: Place the statements below in the correct location in the table: | Definition | Colour Depth | Resolution | |---|---|---| | Higher quality image, the more memory required to save it and may take longer to process. | The number of bits used for each colour. | The number of pixels that make up an image. | | More realistic pictures, the more memory required to save it and may take longer to process. | | | | Lower quality image, may look pixelated. Less memory required, quicker to load. | | | | Less colours within the image, less memory required to save it, quicker to load. | | | | | | | ## Data Representation: Hexadecimal Dealing with large binary numbers can get confusing. Hexadecimal (hex) is a base 16 system used to simplify how binary is represented for humans. | Denary | Binary | Hexadecimal | |---|---|---| | 0 | 0000 | 0 | | 1 | 0001 | 1 | | 2 | 0010 | 2 | | 3 | 0011 | 3 | | 4 | 0100 | 4 | | 5 | 0101 | 5 | | 6 | 0110 | 6 | | 7 | 0111 | 7 | | 8 | 1000 | 8 | | 9 | 1001 | 9 | | 10 | 1010 | A | | 11 | 1011 | B | | 12 | 1100 | C | | 13 | 1101 | D | | 14 | 1110 | E | | 15 | 1111 | F | Computers cannot read hexadecimal (only binary). Hex must be translated into binary for computers to use. A hex value represents the numbers 0-15 as follows: 0123456789ABCDEF The table to the right shows how each hex value reflects a 4-bit binary sequence (nibble). For example: The 8 bit number 1101 0100 in binary is simply D4 in hex. FFFFFF in hex is much simpler to write than the 24 bit number 1111 1111 1111 1111 1111 1111 1111 1111 in binary! Hex codes are used in many areas of computing including: * To define memory locations. * To define colours, e.g. on web pages and graphic design software. * To represent MAC addresses, the hardware identification number which uniquely identifies each device on a network (the computing equivalent to a postal address). * To display error messages - hexadecimal is used to define the memory location of the error. * To represent Unicode. ## Converting Hexadecimal to Denary Example: Convert the Hexadecimal value AA into Denary. 1. As with binary, create a table. Add the numbers 1 and 16 as shown. Add the hex values to the table: | Denary | Hex | |---|---| | 1x | A | | 16x | A | 2. Use the table above to convert the separate values into denary. | Denary | Multiply | |---|---| | 10 | | | 10 | | 3. Multiply them by the according number at the top of the column. E.g. 10 x 16 = 160, 10 x 1 = 10. Add the numbers together to get your denary number. | | Denary | Multiply | |---|---|---| | 1. Hex | A | | | 2. Denary | 10 | | | 3. Multiply | 160 + 10 = 170 | | ### Task: Convert the hexadecimal numbers below into denary. | Hexadecimal | Denary | 16x | 1x | Denary | |---|---|---|---|---| | 0 | 0 | 0 | 0 | 0 | | 1 | 1 | 0 | 1 | 1 | | 2 | 2 | 0 | 2 | 2 | | 3 | 3 | 0 | 3 | 3 | | 4 | 4 | 0 | 4 | 4 | | 5 | 5 | 0 | 5 | 5 | | 6 | 6 | 0 | 6 | 6 | | 7 | 7 | 0 | 7 | 7 | | 8 | 8 | 0 | 8 | 8 | | 9 | 9 | 0 | 9 | 9 | | A | 10 | 0 | 10 | 10 | | B | 11 | 0 | 11 | 11 | | C | 12 | 0 | 12 | 12 | | D | 13 | 0 | 13 | 13 | | E | 14 | 0 | 14 | 14 | | F | 15 | 0 | 15 | 15 | | Hexadecimal | Denary | 16x | 1x | Denary | |---|---|---|---|---| | A | | | | | | B | | | | | | 5 | | | | | | C | | | | | | 4 | | | | | | D | | | | | | 1 | | | | | | 0 | | | | | | F | | | | | | F | | | | | ## Convert Denary and Binary to Hex Example: Convert the denary number 165 into hexadecimal. 1. Create a binary table: | Place Value | Hex | |---|---| | 128 | | | 64 | | | 32 | | | 16 | | | 8 | | | 4 | | | 2 | | | 1 | | 2. Place the number 1 under each number you need to make up 165 and a 0 under any unused place values. | Place Value | Hex | |---|---| | 128 | 1 | | 64 | 0 | | 32 | 1 | | 16 | 0 | | 8 | 0 | | 4 | 1 | | 2 | 0 | | 1 | 1 | 3. Split the number into two nibbles: | Place Value | Hex | |---|---| | 128 | 1 | | 64 | 0 | | 32 | 1 | | 16 | 0 | | 8 | 0 | | 4 | 1 | | 2 | 0 | | 1 | | | | 8 | | | 4 | | | 2 | | | 1 | | Place Value | Hex | |---|---| | 128 | 1 | | 64 | 0 | | 32 | 0 | | 16 | 0 | | 8 | 1 | | 4 | 0 | | 2 | 1 | | 1 | 1 | | | 8 | | | 4 | | | 2 | | | 1 | 4. Add up both nibbles separately. In this example, the first nibble adds up to 10 (hex A) and the second adds up to 5 (hex 5) which means that 165 in Hex is A5. | | A | 5 | It is much easier to convert denary into binary before converting into hexadecimal. ## Denary Numbers into Hexadecimal ### Task 1: Convert the denary numbers below into hexadecimal. | Hexadecimal | Denary | Binary Place Value | Binary Number | Hex Number | |---|---|---|---|---| | 0 | 0 | 8 | | | | 1 | 1 | 4 | | | | 2 | 2 | 2 | | | | 3 | 3 | 1 | | | | 4 | 4 | | | | | 5 | 5 | | | | | 6 | 6 | | | | | 7 | 7 | | | | | 8 | 8 | | | | | 9 | 9 | | | | | A | 10 | | | | | B | 11 | | | | | C | 12 | | | | | D | 13 | | | | | E | 14 | | | | | F | 15 | | | | | Denary Number | Binary Place Value | Binary Number | Hex Number | |---|---|---|---| | 10 | 8 | | | | 15 | 4 | | | | 220 | 8 | | | | 190 | 8 | | | | 128 | 64 | | | ## Year 8 Knowledge Organiser: Computational Thinking & Algorithm Design ### Data Types * Integer (whole number) e.g. 1, 2, 3, 4 * Real (decimal number) e.g. 1.1, 4.2, 3.357, etc. * Character (singular characters that join to make a string eg. a. F, 5, %, 5, 7 and [space] * String (ordered sequences of characters) e.g. abc, hello world. Must be written in "quotation marks" * Boolean produces true or false outputs. Common operators include AND, OR and NOT. ### Boolean Operators There are used to make compansons within decisions | Operator | Meaning | |---|---| | > | Greater than | | < | Less than | | = | Equal to | | != | Not equal to | | AND | Both conditions are TRUE | | OR | At least one condition is TRUE | ### Mathematical Operators | Operator | What It does | |---|---| | + | Addition | | - | Subtraction | | / | Division | | * | Multiplication | ### Selection (IF then else) ![Selection flowchart](Selection flowchart.png) ### While Loop ![While Loop flowchart](While Loop flowchart.png) ### Counting Loop ![Counting Loop flowchart](Counting Loop flowchart.png) ### Keywords in Computer Programming * Computational Thinking: The ability to solve problems logically * Variable. A memory location where values are stored. Can be used locally within a procedure or function or globally across the whole script. * Sequence: a set of instructions or actions in order, meaning that each action follows a previous action. For example, Switch alarm clock off, go shower, brush your teeth, put on clothes, eat breakfast, go to school. * Selection: A decision has one input and two possible outputs. For example, If you want to ride on the front of the rollercoaster, Then go to queue 1 Else go to queue 2. * Iteration: This involves repeating actions (WHILE). For example, While your age is equal to or greater than 11 or equal to or less than 18, attend secondary school. * Syntax Errors: These are mistakes in the way that the code is written. * Logic Errors: These occur when the algorithm works but produces different results from what you designed or expected. * Runtime Errors: A runtime error happens when a program is asked to do something that it cannot. This can result in a 'crash'. * Debugging: Identification and amendment of errors within an algorithm. ### Application of Mathematical and Boolean Operators See how mathematical and Boolean operators can be used: | | Algorithm | |---|---| | START | Time = 10 | | | WHILE Time < 20 | | | Time = Time + 1 | | | ELSE | | | Time Up! | | | ENDIF | | | END | ### Computational Thinking * **Decomposition:** breaking down a complex problem or system into smaller, more manageable parts. * **Pattern Recognition:** looking for similarities among and within problems. * **Abstraction:** focuses on the important information only, ignoring irrelevant detail. * **Algorithm Design:** the creation of a step-by-step solution to the problem, or the rules to follow to solve the problem. ### Writing Algorithms ### Practice Questions and Activities #### Q1 Give two examples of print() that will lead to errors. 1. print("Hello, world!" 2. print(Hello, world!) #### Q2 Describe what variables are and what they're used for. Variables act as placeholders for information within a program. They can store text, numbers, and other data types. Variables are essential for managing and manipulating information during program execution. #### Q3 For each of these scenarios, give a suitable example of a variable (or variables) and explain what they could be used for in the program. a) A computer is linked to a sensor that is used to measure the height of a sunflower over the summer. - Variable: **sunflowerHeight** (Data type: float or integer) - This variable would store the measured height of the sunflower at different points in time. b) A video game that keeps track of the individual scores two players get in three separate levels, as well as their overall score. - Variables: - **player1Level1Score, player1Level2Score, player1Level3Score** (Data type: integer) - **player2Level1Score, player2Level2Score, player2Level3Score** (Data type: integer) - **player1TotalScore, player2TotalScore** (Data type: integer) - These variables would store the scores for each player individually on each level and the overall score. #### Q4 For each program below, track the changes and circle what will be printed to the user's screen. a) ```python netball = 5 tennis = 6 cricket = netball netball = 6 tennis = 0 print(cricket) ``` Output: 5 b) ```python football = "Twelve" rugby = 5 + 2 + 2 hockey = 12 rugby = hockey + 1 squash = rugby - 1 print(squash) ``` Output: 12 c) ```python swimming = 2 swimming = swimming + 4 dance = 2 dance = dance + 1 swimming = dance + swimming print(swimming) ``` Output: 9 #### Q5 Write a brief description of what is happening in each line of code and give the final output. ```python profit = 0 revenue = 10000 totalCosts = 4000 profit = revenue - totalCosts print("The profit is", profit) ``` * **profit = 0** - This line initializes a variable called "profit" and sets its initial value to 0. * **revenue = 10000** - This line sets the value of the "revenue" variable to 10000. * **totalCosts = 4000** - This line assigns a value of 4000 to the variable "totalCosts". * **profit = revenue - totalCosts** - This line calculates the profit by subtracting the total costs from the revenue. * **print("The profit is", profit)** - This line prints the final profit to the console, which would be 6000. Output: The profit is 6000 ## Flowchart and Pseudocode ### Task: Write the pseudocode for this flowchart ![Flowchart](Flowchart.png) ```python START OUTPUT "Enter number" INPUT Number CLEAR SCREEN OUTPUT "Enter guess" INPUT Guess IF Guess = Number THEN OUTPUT "You win!" STOP ELSE OUTPUT "YOU LOSE!" ENDIF END ``` ### Task: Draw a flowchart for a program that performs the following: Ask a user to enter a number. If the number is between 0 and 10, write the word blue. If the number is between 10 and 20, write the word red. If the number is between 20 and 30, write the word green. If it is any other number, write that it is not a correct colour option. ![Colour Number Flowchart](Colour Number Flowchart.png)