IGCSE Computer science notes, Exams of Computer Science

IGCSE Computer science notesIGCSE Computer science notes

Typology: Exams

2025/2026

Available from 12/12/2025

kind-wing
kind-wing 🇺🇸

747 documents

1 / 21

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download IGCSE Computer science notes and more Exams Computer Science in PDF only on Docsity!

IGCSE Computer science notes The 3 basic programming constructs: - Sequence: an ordered set of instructions. E.g strings, lists - Selection: decisions and choices. E.gif, else , elif - |teration: repetition. E.g for and while loops Algorithms : A precise methad for salving a problem. It's a sequence of steps that can be used again and cannot be misunderstood. Decomposition: Breaking down a problem into smaller parts to make it easier to solve. Flowcharts: Function An oval represents a start CC) Start/end or end point Sirown Logical flow of the —_> algorithm Aparallelogram Inpitiouteue represents input or output Arectagle represents a || saims BIOCESS. Decision Adiamond indicates a decision Representing iteration and selection in flowcharts: - Make sure to use “Is” followed by question mark These arrows represent the iteration. if the answer is ‘NO* then the selection question is repeated until the answer is There is a question with two: “YES' - the desired outcome. alternatives. This represents the selection. Data Types: Integers Whole numbers 30 Strings Words or sentences "Hello world” real / float Decimals 1.23 Characters Single letters "K Booleans True or False False Variables vs Constants Both are containers used to store data. Variables values are not fixed and can be changed through the code. constant's values are fixed and aren't changed. Constants are represented by naming them in uppercase. If , Else, ELif, and Relational operators: If, elif, else statements are used in decisions. RELATIONAL OPERATOR PYTHON, JAVA, C# Equal to = Greater than > Greater than or equal to >= Less than < Less than or equal to <= Not equal to l= Logical operators: and,or,not Order of logical operators (important for truth tables where logical operators are in one single statement): - BRACKETS - NOT - AND - OR We use truth tables to show how logical operators work. Remember, 0 means False and 1means True. AND: Here, both inputs have to be TRUE. Input A Input B Output 0 0 0 Readability of code: You can improve the readability of your code by using comments. 1. comments explain how the program works 2. Improves readability of the code 3. Makes code more understandable Comments in python start with # Repetition( while loops): Nested loops are loops within a loop. While loops are indefinite. They're usually used with a counter. The syntax is as follows: namez= input("whats your name : ") while name !="Bob": the colon is important as it creates the indentations | print("please enter a valid name") = *here, the indentation shows that everything in I name= input("whats your name :") yellow isin the while loop print("correct") Strings: Indexing: Computers start counting from 0. So the first character of a string would beO. Library functions: Library functions are used to manipulate strings. len() -isalpha() sisdigit() upper() lower() -isupper() sislower() replace() String.format() : string .format() function makes code more user friendly and understandable. Name = input(‘enter name") age = int(input(“enter age”) print( "{} is {} years old”.format(Name, age)) The name and age will be replaced in the string no matter what you write . For loops: For loops are counter- controlled loops that are used to iterate text a specific number of times. There are For loops and for in range loops. Eorloons to iterate through alist: output: Bob John Smith names :[“Bob”, “John”, “Smith” ] For xin names: print(x) For loops in range: Output: For i in range(1,4): 4 int (i print (i) 3 Data structures A data structure is a container that can hold several items at the same time. E.g Arrays and lists. Arrays: A data structure that contains elements of the same data type. arrayExample=[ 1, 2,3,45 ] List : A data structure that contains elements of different data types. listExample=[“bob" , 32, 4.5, “john’] Lists are better than arrays because they are dynamic. - You can add to alist using the .append() function - You can remove an element using the .remove() function - Using the del function, you can delete an element using its index. E.g, Minutes =[12,43,56,75] del Minutes[2] this will delete 56. Two dimensional lists: are lists inside a list In order to access an element from a two dimensional list, you use this indexing table [1]2] | waseeeenitie O table 2a O| 16 54 12 isi | 65 32 98 So this is 98 2 - 84 = 3 48 59 34 lterating through this list: forrowintable: this goes through each list in the list for element in row: this goes through each element print (element) Subprograms: 128 64 32 16 8 4 2. 1 Binary addition : 4 Rules: - O+1=1 - 1=Ocarry1 - 1+14+1=1carry1 - 0+0=0 Overflow error : occurs when a calculation produces a result greater than the computer can deal with. Its put in brackets. Sign and magnitude: where the most significant bit (msb) determines sign of the integer. O=POSITIVE 1= NEGATIVE Twos complement: used to present signed(negative) integers - First turn into positive binary - Flip all bits so O=1 and 1=0 - Add 1 E.g-81 Positive 81 in binary= 0101 0001 Flip digits = 1010 1110 Add 1: 1010 1110 + 1 {GIO is -81 Logical shifts: e Left shifts(multiplication) : add Os to the end and discard what does not fit. If multiply by 27, then we add two Os at the end. e Right shifts(division) : add Os to the beginning and discard what does not fit Arithmetic shifts: e Left shifts: keep msb as it is, and add Os to the end and discard what does not fit e Right shifts: keep msb as it is, discard the numbers in the end by number of places, shift then replace rest with msb sign Hexadecimals: Converting hex to binary: 3AB2 3=0011 A= 1010 B= 1011 2= 0010 So , 3AB2 = 11 1010 1011 0010 What are hexadecimals used for? - Reduces large strings - Makes it easier for humans to process - Usedin html colour codes - Error messages ASCII American Standard Code for Information Interchange A=65 a= 97 ASCII represents 128 unique characters. Ascii table: https://www.asciitable.com/ Unicode was created to hold 16 bits and represent other languages (other than english)and emojis and symbols THEORY: Hardware: Von neumann architecture is a computer system where the proaram is stored in memory with the data. Its made up of - Processor - Memory - Secondary storage Fetch: The CPU fetches the next instruction from the RAM (or cache) Decode: The CU decodes the instruction to found out what it is asking the CPU to do Execute: Using the ALU the CPU carries out the task specified by the instruction. The CPU may need to fetch more data from the main memory. The results are stored in the accumulator. Buses: Address bus_ | Transfers the location/address of data required by the CPU. its UNI-directional Data bus Transfers data to and from the address that's stored. Bl-directional Control bus Carried control signals from CU to other components. Its BI directional 2 factors that affect CPU performance: - Clock speed - Bus speed Increasing clock speed disadvantage: generates a lot of heat Advantages of multicores: e Parallel processing e multitasking Secondary storage: a permanent storage where the contents of RAM/ROM are copied. - Magnetic - Optical - Solid state General purpose device : A computing device that can have different application programs loaded into it to provide different or enhanced functionality. For example, a smartphone can also be used as a calculator and a camera. Magnetic: magnetic media are coated with a substance that can be magnetised Magnetic storage technology works by magnetising parts of this substance as north and south poles to represent binary 1s and Os. Examples :- hard disk and tape drive Advantages Disadvantages - High capacity Has moving parts - Quick to access Optical : Optical media consist of a platter with a flat reflective surface. It works by using laser to create lands and pits.Land represents 1s and pits represent Os Examples:- CD and DVD drives Advantages Disadvantages - Cheap - Slow - Thin and lightweight - Low capacity - Portable Solid State: Solid-state media consist of silicon chips that feature a special kind of transistor called NAND flash. This type of media is called ‘solid state’ because it has no moving parts. Solid-state technology works by using a large electric current to force electrons through a barrier, trapping them in positions called ’pools’.A full pool represents 0 and an empty pool represents 1. Root Directory Games2) |Games3]| | Games4) es JP O.One Unit Abbreviation Bytes Equivalent to bit 1 bit nibble 4 bits byte 2° bytes 8 bits or 2 nibbles kibibyte KiB 219 bytes 1024 bytes mebibyte MiB 220 bytes 1024 kibibytes gibibyte GiB 230 bytes 1024 mebibytes tebibyte TiB 24° bytes 1024 gibibytes When calculating required space, make sure to use the binary units and not denary units. Its also important to use the ceiling function. Ceiling is basically rounding to the next number and this is its symbol I’ 1. Levels of access: Read - users can view the content of a file but not alter it Write - users can read and amend the contents of a file Execute - users can execute the file (if it is a program executable file) Delete - users can delete a file. Process management: Scheduling: The algorithm that the OS uses to allow each running process to use the CPU. There are three types of processes : - Runnable - Running - Waiting processes It controls how the CPU is used to make the computer system run the most efficient way, and optimises computer performance. Scheduling should : - Maximise CPU usage and number of instructions passed - Minimise time taken to complete instructions Types of scheduling: First come First serve (FCFS) : The easiest and simplest algorithm. The instructions are dealt with in order of time input Advantages Disadvantages Low overhead ( waste of time ) Throughput(number of process that are being completed over time ) can be low Processes are never starved No prioritisation of tasks User friendly/ easy Not very efficient Round Robin: Oldest scheduling algorithm. The CPU is split into time slices and each instruction waiting is allocated a time slice. If the instruction cannot be completed, it must then wait until all other instructions have been given CPU time, before getting the next time slice. Advantages Disadvantages Balanced throughput Some overhead involved in switching processes Average response time is good Processes may have to wait a long time before being processed Process are never starved No prioritisation Shortest job first : Here the OS decides which of the waiting processes will be shortest to complete, and they are given priority for CPU time leaving longer processes till later. Advantages Disadvantages Average wait time is slow Long processes can be starved Response for short tasks are fast Execution time must be known NETWORKS: (two or more computers connected together for the purpose of sharing resources and data.) Different types of networks: * LAN: local area network. A network that covers a small geographical areale.g office) * WLAN; wireless local area network: a LAN in which connected devices use high frequency radio waves to communicate. * WAN ; wide area network: a network that covers a large geographical area. E,g the internet +* PAN; personal area network: network used for data transmission over short distances by devices. Usually in smart homes Network Speed: Bandwidth : the amount of data that can be carried on a network in a given period of time. Its measured in bits per second(bps) Latency: any kind of delay that data travelling through a network might encounter. Network speed is in bps. Units Abbreviation bits per second bits per second bps 1 kilobits per second Kbps 1000 megabits per second Mbps 1000 000 gigabits per second Gbps 1000 000 000 Calculating transmission time . In order to calculate the estimated time for a file to be transmitted, you need to construct an expression. The basic formula for ‘time to transmit a file’ is: . file size (in bits) time = ———___—_. network speed (in bps) In order to construct the expression, you need to convert the file size into bits and network speed into bits per second. Client- server network: Aclient(computer) requests from the server for data and directions. Advantages Disadvantages Easier to manage computer files Expensive Easy to backup Requires IT specialists Easy to install software updates Server is single point of failure User will lose access if server fails Peer to Peer Network: A network that doesn't have dedicated servers. Each computer in the network can act as client and server. Advantages Disadvantages Very easy to maintain Network is less secure Specialised staff isn't required Users need to manage backups Cheap and no expensive hardware Slow performance as each computer is required accessed by other users Network Topologies : 1. BUS: A bus network consists of a single cable with which each networked device is connected .At each end of the cable is a terminator. The terminator prevents any interference(collisions) which may lead to unreadable messages. The bus topology uses a system called CSMA/CD. a “8 = | Computer ‘Computer Bo! es A Figure 6.2 Bus notworktopclogy 3. STAR: Each device is connected to a central point, either a hub or a switch. The central hub receives and directs messages. It is widely used. Coxmputer Computer Computer Advantages Disadvantages A damaged Cable will not stop the network If hub/switch fails, whole network fails If switches is used = efficient = more security Expensive - lots of cables and the hub/switch Easy to locate faults New device can be easily added/removed 4. MESH: There are two types of mesh topologies: |. Fully connected : Every network is connected to every other device Il. Partially connected : some networks may be connected to multiple devices or only one device Mesh networks can be wired or wireless Advantages Disadvantages Very fault tolerant- if one device fails, others will re-route Difficult and expensive to install WIRED networks Very high performance- each device is connected to other devices Can be difficult to manage In wireless networks each node extends the range of network Wired networks: Involves a physical connection between the device and the network. Examples include: - Fibre optics{ transmit data fast and allow signals to travel further. Carries light signals) - Copper wires: carries electrical signals Wireless networks: They do not require a physical connection. They tramist and receive radio signals. Examples include : - Wi-Fi - Bluetooth - NFC - RFID - Zigbee Advantages and disadvantages. Wired vs wireless: