Search CSNewbs
304 results found with an empty search
- Python | Section 2 Practice Tasks | CSNewbs
Test your understanding of inputs in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python - Section 2 Practice Tasks Task One: Food & Colour Ask a user to input their favourite colour and their favourite food and then print a response using both answers. Requirements for a complete program: Use only one print line. Include both of the user's answers in the print line. Include capital letters, full stops and no irregular spacing in the printed line. Remember: Break up variables in a print line by using commas or plus signs between each part of the "sentence" . Example solutions: What is your favourite colour? green What is your favourite food? cheese Yum! I'll have green cheese for dinner tonight! What is your favourite colour? purple What is your favourite food? ice cream Let's have purple ice cream for breakfast! Task Two: Trivia Question Create a program that asks the user to input an answer to a trivia question of your choice then prints the correct answer with their response too. Requirements for a complete program: Only two lines. Include capital letters, full stops and no irregular spacing in the printed line. Example solution: What is the capital city of Botswana? Windhoek Correct answer: Gaborone. Your answer: Windhoek What is the closest planet to Earth? Mars Correct answer: Mars. Your answer: Mars Task Three: Getting to School Create a program that asks the user how they get to school and how many minutes it takes them (using int ). Then print an appropriate response that uses both variables . Requirements for a complete program: Use only one print line. Include both of the user's answers in the print line. Include capital letters, full stops and no irregular spacing in the printed line. Example solution: How do you get to school? car How many minutes does it take you? 45 Really? It takes you 45 minutes to get here by car? How do you get to school? walking How many minutes does it take you? 20 Really? It takes you 20 minutes to get here by walking? ⬅ 2b - Inputting Numbers 3a - Data Types ➡
- 2.4c - Character Storage - OCR GCSE (J277 Spec) | CSNewbs
Learn about the main character sets - ASCII (American Standard Code for Information Interchange) and Unicode. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 2.4c: Character Storage Exam Board: OCR Specification: J277 Watch on YouTube : Character Sets ASCII Unicode Text File Size What is a Character Set? A character set is a table that matches together a character and a binary value . Each character in a character set has a unique binary number matched with it . Character sets are necessary as they allow computers to exchange data and humans to input characters . Two common character sets are ASCII and Unicode : H = 01001000 ASCII Unicode ASCII (American Standard Code for Information Interchange ) is a common character set which does not take up much memory space . It is important to understand that the number of characters that can be stored is limited by the bits available - ASCII uses 1 byte (8 bits ) which only gives 256 possible characters . This is enough for the English language but it can’t be used for other languages or all punctuation symbols. Unicode is a more popular character set because it uses 2 bytes (16 bits ) that allow for 65,536 possible characters . The extra byte allows many different languages to be represented , as well as thousands of symbols and emojis . However Unicode requires more memory to store each character than ASCII as it uses an extra byte . Character sets are logically ordered . For example, the binary code for A is 01000001 , B is 01000010 and C is 01000011 as the code increases by 1 with each character. The file size of a text file is calculated as shown below: bits per character x number of characters Example: A small text file uses the ASCII character set (which uses 8 bits per character ). There are 300 characters in the file . 300 x 8 = 2,400 bits This could be simplified as 300 bytes or 0.3 kilobytes . File Size of Text Files 01101010 = 256 possible characters 8 bits (1 byte) 1000101101001111 = 65,536 possible characters 16 bits (2 bytes) Q uesto's Q uestions 2.4c - Character Storage: 1. What is a character set and why are they needed ? [ 2 ] 2. Describe 3 differences between ASCII and Unicode . [6 ] 3. The binary code for the character P in ASCII is 01010000 . State what the binary code for the character S would be. [1 ] 4a. A text file uses the ASCII character set and contains 400 characters . What would the file size be in kilobytes ? [ 2 ] 4b. A text file uses the Unicode character set and contains 150 characters . What would the file size be in kilobytes ? [ 2 ] 2.4b - Binary Addition & Shifts Theory Topics 2.4d - Image Storage
- 11.2 - Legislation - Eduqas GCSE (2020 Spec) | CSNewbs
Learn about key computing laws including the Data Protection Act (2018) (GDPR), Computer Misuse Act (1990), Copyright Designs and Patents Act (1988), Creative Commons and the Regulation of Investigatory Powers Act. Based on the 2020 Eduqas (WJEC) GCSE specification. 11.2: Legislation Exam Board: Eduqas / WJEC Specification: 2020 + Data Protection Act (2018) In 2018 the European Union introduced GDPR (General Data Protection Regulation ) to protect the privacy of data for people in the EU. The UK matched this by updating the Data Protection Act introduced in 1998 to become the Data Protection Act (2018) . This act protects the data of individuals that is stored on computers and processed by organisations. How the Data Protection Act works: Each person who has their data stored is known as a data subject . An employee within an organisation must be appointed as a data controller and it is they who are responsible for registering with the Information Commissioner . The Information Commissioner is the person in the UK who is responsible for managing several laws , most significantly the Data Protection Act. When registering with the Information Commissioner, the organisation's data controller must be clear on exactly: What information they are collecting, Why it is being collected, What the data will be used for . The six principles of the Data Protection Act state that data must be: 1. Collected lawfully and processed fairly. 2. Only used for the reasons specified. 3. Data must be relevant and not excessive. 4. Data must be accurate and up-to-date. 5. Data must not be stored for longer than necessary, 6. Data must be stored and processed securely. Computer Misuse Act (1990) This act was introduced as computers became cheaper and more common at home and work . The act attempts to stop and punish those who use computers inappropriately . Breaking any of the three principles could result in fines and a jail sentence but only if it can be proved it was done on purpose and not by accident. The Computer Misuse Act (1990 ) includes three main principles : 1. No unauthorised access to data. Example: Hacking a computer system. 2. No unauthorised access to data that could be used for further illegal activities. Example: Accessing personal data to use as blackmail or identity theft. 3. No unauthorised modification of data. Example: Spreading a virus to change data. Freedom of Information Act (2000) This act allows people to request public authorities to release information . Public authorities include local councils , government departments , universities and hospitals . A freedom of information request must be formally submitted in a letter or email and a reply from the organisation is required within twenty days of receiving the request. A simple freedom of information request might be the average response times of the local ambulance service in the past year. Certain requests will not be accepted , such as if processing the request would be too expensive or if it involves sensitive information protected by the Data Protection Act (2018 ). Regulation of Investigatory Powers Act (2000) This act (often shortened to RIPA ) was introduced in response to the increase in both criminal and terrorist activities on the internet, it is used to monitor and access online communication of suspected criminals . If criminal activity is suspected by an individual then this act grants the following powers : Internet Service Providers (ISPs) must provide access to the suspect's online communication , such as emails or social media. Locked or encrypted data may be accessed such as online messages. ISPs could install surveillance equipment or software to track the suspect's online activity . Surveillance may take place to physically track the suspect , e.g. in private vans or by undercover officers in public spaces. Access must be granted to personal information . This act became controversial as its use widened and local councils were using it for minor offences - a Scottish council used the act to monitor dog barking and a council in Cumbria gathered video evidence about who was feeding pigeons . The act has since been changed to only allow the surveillance of crime suspects . Copyright, Designs & Patents Act (1988) This act makes it a criminal offence to copy work that is not your own without the permission of the creator or the copyright holder. This can refer to text, images, music, videos or software. Owning the copyright of an image might not prevent others from copying and using it but this act means that the owner can bring legal proceedings in court to those who have stolen their work . However, it is difficult to trace who has stolen work once it has been uploaded to the internet and copies can easily spread, especially television shows and movies. This act specifically prohibits the following actions: Making copies of copyrighted material to sell to others . Importing and downloading illegally copied material (except for personal use). Distributing enough copyrighted material to have a noticeable effect on the copyright holder . Possessing equipment used to copy copyrighted material , as part of a business. Creative Commons (CC) Licensing A CC licence allows people to share their copyrighted work while still retaining rights to the material . There are different types of licence that specify exactly what can and can't be done to the copyrighted material. For example: An attribution licence allows copyrighted material to be edited and distributed but the original owner must be credited . A non-commercial licence allows copyrighted material to be shared and edited but no profit must be gained through its distribution. CC licences are not automatically given , they must be granted by the copyright owner . To ensure you are not illegally using copyrighted work change the Tools and Licence setting when using Google Images to filter work with CC licenses applied . Telecommunications Regulation Act (2000) This act allows organisations to lawfully monitor communications made online and on the phone by employees while at work . All users of the network should be aware that their communication is being monitored when they are using emails , the internet or telephone calls . The act was introduced to ensure that employees are using the computer systems for the correct purpose , to prevent illegal activity and to monitor staff performance . Codes of Conduct One way that organisations try to ensure that staff are held to professional standards and display appropriate behaviour is to create a code of conduct . This is a set of rules or requirements that employees must follow or they may be punished, such as a temporary ban from the network or being fired. There are two types of codes of conduct: Formal codes of conduct are a set of written rules that clearly state expected behaviour , such as what employees can access online at work . Schools may have this too, and you might have to sign a document at the start of the year before you can use the computers. Informal codes of conduct are used by small organisations where there might not be a written set of rules , but newer employees follow the habits and expectations of senior members of staff. This is harder to monitor but provides a more relaxed working environment. Q uesto's Q uestions 11.2 - Legislation: 1a. State the 6 principles of the Data Protection Act (2018) . [ 6 ] 1b. Explain how the Data Protection Act works . In your answer, you should include definitions of a data subject , the data controller and the Data Commissioner . [ 6 ] 2. Describe the 4 principles of the Computer Misuse Act (1990) . [3 ] 3. Describe the purpose of the Freedom of Information Act (1990) and state an example of a freedom request . [ 3 ] 4a. What is the purpose of RIPA (2000) ? [ 2 ] 4b. Describe 3 actions that RIPA (2000) allows the government / police to do . [ 3 ] 5a. What is the purpose of the Copyright, Designs & Patents Act (1988) ? [ 2 ] 5b. Describe 3 actions that CDPA (1988) prohibits . [ 3 ] 6a. What is a Creative Commons ( CC ) licence ? [ 2 ] 6b. Describe 2 types of CC licence . [ 4 ] 7a. What is the purpose of the Telecommunications Regulation Act (2003) ? [ 2 ] 7b. Describe 3 reasons why this act was introduced . [ 3 ] 8a. What is the purpose of a code of conduct ? [ 2 ] 8b. Describe the difference between formal and informal codes of conduct . [ 2 ] 11.1 - Impacts of Technology Theory Topics
- HTML Guide 4 - Hyperlinks | CSNewbs
Learn how to link to other websites by using the anchor tag. 4. Hyperlinks HTML Guide Watch on YouTube: A hyperlink is a link to another web page . In this section, you will link your page to a real website, like Wikipedia. Hyperlinks require the anchor tags and Copy a URL Firstly you need to copy the full web address of the web page that you would like to link your page to. Choose an appropriate web page that relates to your chosen topic. Create the Anchor Tag 4. Close the start of the tag . 1. Open the start of the tag . 2. Type href (stands for hypertext reference ). 3. Paste the URL inside speech marks . 5. Type the text you want the user to click on . 6. Time to close the tag . When you save your webpage and run it in a browser you will be able to click highlighted text to open the website you have chosen. Add at least three different hyperlinks to your webpage. Try to add the 2nd & 3rd links without looking at this page - practise makes perfect. Add a Hyperlink within a Sentence You can also create an anchor tag within a sentence. Hyperlinks are important to link webpages together. Next is time for adding pictures! Either change one of your previous hyperlinks to be in the middle of a sentence or create a new one. 3. Text Tags HTML Guide 5. Images
- Python | Extended Task 7 | CSNewbs
Test your ability to create a more complex program in Python based on a given scenario. Perfect for students learning GCSE Computer Science in UK schools. Extended Task 7 'Guess the Number' Multiplayer Game A primary school teacher wants to create a fun activity for their students to play when it is raining and they have to stay inside during break and lunch. Five pupils can play the game at once. Each player chooses a number between 1 and 100 . Then a random number is generated. Whoever was furthest from the random number is out of the game . The four remaining players then pick a new number . This continues with one player being removed each round until only one player is left and they are the winner. Add your own flair and additional features to your program as an extension, including preventing the same number being chosen by multiple players . For this task, you will need to create a document and include the following sections (with screenshots where appropriate): An introduction to explain the Purpose of your program . A List of Requirements for a successful program. Screenshots of your code (with comments in your code to show understanding). Testing – Create a plan to show how you will test your program and then explanations of any errors that you found and how they were fixed . An Evaluation of what worked, what didn’t, and how you met each of your requirements from your original list. Also, discuss further improvements that you could have made to improve your program. Reminders for this task: You will need to use loops to allow the users to enter their numbers. You may wish to use subroutines to decompose the problem into separate rounds. You will need to import the random library to generate a random number in each round. You will need to compare each number to the randomly selected answer using comparison operators such as > and <. There are multiple ways to approach this program, and your solution might look different from the example. Break the problem down and focus on one part at a time. Example solution: Introduction & Round One Round Two ⬅ Extended Task 6 (Word Game)
- 2.2 - Computational Methods | OCR A-Level | CSNewbs
Learn about computational methods including problem recognition, decomposition, divide and conquer, abstraction, backtracking, data mining, heuristics, performance modelling, pipelining and visualisation. Based on the OCR H446 Computer Science A-Level specification. Exam Board: OCR A-Level Specification: Computer Science H446 2.2 - Computational Methods Watch on YouTube : Problem recognition Decomposition Divide and conquer Abstraction Backtracking Data mining Heuristics Performance modelling Pipelining Visualisation Computational methods are techniques to analyse problems and design efficient , effective solutions . Problem Recognition Problem recognition is the process of identifying that a problem exists and understanding its nature before attempting to solve it. It involves determining the aims of the task , identifying constraints and requirements , and clarifying what inputs , outputs and processes are expected from the solution . Effective problem recognition ensures the developer understands the real-world context and avoids solving the wrong problem or missing key details . It is the essential first step that guides all later stages of computational thinking and system design . YouTube video uploading soon Decomposition Decomposition involves breaking a complex system or task into smaller , more manageable components that are easier to design , implement and test . Each sub-problem should ideally be independent and solve a specific part of the overall task , which helps reduce complexity and supports modular program design . This approach enables different developers to work on different components simultaneously and simplifies debugging , maintenance and future updates . By working through smaller logical parts , the full problem becomes far more approachable and structured . YouTube video uploading soon Divide and Conquer Divide and conquer is a technique that splits a problem into smaller sub-problems of the same type , solves them (often using recursion ), and then combines the solutions to produce the final answer . This approach can significantly improve efficiency by reducing large input sizes into more manageable chunks , as seen in algorithms like quicksort . Divide and conquer algorithms include a binary search and a merge sort . The time complexity of divide and conquer algorithms is logarithmic - O(log n) - allowing complex problems to be solved much quicker than other algorithms . YouTube video uploading soon Abstraction Abstraction means removing unnecessary details to focus only on the most important features of a problem or system . It allows programmers to create simplified models that capture essential behaviour without becoming overwhelmed by irrelevant complexities . Abstraction enables generalisation , reusable designs and clearer reasoning about how components interact . In computational contexts, abstraction also highlights the difference between real-world systems and their simplified computational models . YouTube video uploading soon Backtracking Backtracking is used to explore possible solutions to a problem by building a partial solution and abandoning it as soon as it becomes clear it cannot succeed . It works by trying an option , checking whether it leads towards a valid solution , and backtracking to try a different path if a dead end is reached . This approach is used in constraint-based problems such as maze solving . While powerful , backtracking can be computationally expensive , so it often benefits from heuristics or pruning strategies . YouTube video uploading soon Data Mining Data mining is the process of extracting useful patterns , trends and relationships from large datasets . It enables organisations to identify hidden insights , predict behaviours and support data-driven decision-making , particularly in fields such as marketing , healthcare , finance and security . Data mining can lead to enhanced decision-making that can result in innovation , a competitive advantage against similar organisations and increased revenue . It can be used to identify anomalies or unused features . However, data mining doesn't explain the patterns it can identify and it requires powerful computers with a lot of processing power to handle huge amounts of data . YouTube video uploading soon Heuristics Heuristics are approximate problem-solving strategies that aim to produce good solutions quickly when exact , optimal methods are too slow or computationally impractical . They rely on rules of thumb to guide searches through very large solution spaces efficiently . Heuristics are widely used in artificial intelligence , optimisation tasks and complex search algorithms such as A* , where perfect accuracy is less important than fast , practical solutions . The trade-off is that heuristic methods are not guaranteed to produce the optimal answer , but they dramatically reduce processing time . YouTube video uploading soon Performance Modelling Performance modelling is the process of predicting how a system or algorithm will behave under different workloads , input sizes or hardware environments . It uses tools such as mathematical analysis , simulation and Big O notation to estimate required resources such as processing time or memory use . Performance modelling offers a cheaper , quicker and often safer way to test applications . For example, when a company beta tests an online game , it can trial the system with a smaller group of players and then apply performance modelling to predict how much server capacity will be needed when the game is fully released . YouTube video uploading soon Pipelining Pipelining is a technique in which different stages of a process are overlapped so that multiple instructions or operations are being processed simultaneously at different stages . In CPU architecture , for example, one instruction might be fetched while another is decoded and a third is executed , increasing overall throughput without increasing clock speed . Pipelining can also be used in algorithms or data-processing systems to prevent idle time in stages that operate independently . However, pipelining introduces complexity because dependencies or branch mispredictions may require a pipeline to be flushed - interrupting flow and reducing efficiency . YouTube video uploading soon Visualisation Visualisation supports the understanding of a problem by presenting information in a clearer and more accessible form than text alone . It is useful for explaining complex ideas or identifying patterns . Data can be shown visually through diagrams , graphs , trees , flowcharts or tables . The advantages of visualisation include helping to model , represent , analyse or summarise complex concepts . It allows information to be communicated more clearly and in a way that is easier to interpret . It can also provide different perspectives on how a problem might be solved . YouTube video uploading soon This page is under active development. Check here for the latest progress update. Q uesto's K ey T erms Computational Methods: problem recognition, decomposition, divide and conquer, abstraction, backtracking, data mining, heuristics, performance modelling, pipelining, visualisation D id Y ou K now? Real-time location services like Google Maps use heuristics to guess travel times using heuristics such as estimated speeds , traffic history and shortcuts to make fast but approximate route suggestions . 2.1 - Programming Techniques A-Level Topics 3.1a-d - Algorithm Complexity
- 8.1 - Programming Principles - Eduqas (2020 Spec) | CSNewbs
Learn about algorithms including programming principles, variables and sequencing. Based on the 2020 Eduqas (WJEC) GCSE specification. 8.1: Programming Principles Exam Board: Eduqas / WJEC Specification: 2020 + Problem Solving There are four stages to computational thinking (smart problem solving ). Decomposition is when you break a problem down into smaller tasks so that it is easier to solve . Pattern Recognition is the process of identifying similar patterns within a problem . Abstraction is when you ignore unnecessary information and focus only on the important facts . Algorithms are the final stage as step-by-step rules are created to solve the problem . An algorithm is usually written as psuedocode or presented as a flowchart . Programming Constructs There are three constructs (ideas) of programming that most programs will contain: Sequence Structuring code into a logical, sequential order . Selection Decision making using if statements . Iteration Repeating code , often using for loops or while loops . Variables Large programs are often modular - split into subroutines with each subroutine having a dedicated purpose. Local variables are declared within a specific subroutine and can only be used within that subroutine . Global variables can be used at any point within the whole program . Local variable advantages Saves memory - only uses memory when that local variable is needed - global variables use memory whether they are used or not. Easier to debug local variables as they can only be changed within one subroutine. You can reuse subroutines with local variables in other programs. Global variable advantages Variables can be used anywhere in the whole program (and in multiple subroutines). Makes maintenance easier as they are only declared once. Can be used for constants - values that remain the same. Local & Global Variables Constants A variable is data that can change in value as a program is being run. A constant is data that does not change in value as the program is run - it is fixed and remains the same. An example of a constant in maths programs is pi - it will constantly remain at 3.14159 and never change. π π Counts & Rogue Values When using iteration (looping) the loop must eventually be able to stop. A count is a variable that is used to record the current iteration (loop number). A rogue value is an unexpected value that will cause the loop to end . For example by typing "Stop" into a loop that asks for numbers. Self-documenting Identifiers An efficient program will use variables with sensible names that immediately state their purpose in the program. Using variable names like 'TotalNum' and 'Profit' rather than 'num1' and 'num2' mean that other programmers will be able to work out the purpose of the code without the need for extensive comments. Q uesto's Q uestions 8.1 - Programming Principles: Problem Solving 1. What is meant by 'decomposition '? Why is it important ? [2 ] 2. What does the term 'abstraction ' mean? Why is it important ? [2 ] 3. What is pattern recognition ? [2 ] 4a. What is an algorithm ? [1 ] 4b. What are the two ways of writing an algorithm ? [2 ] Programming Constructs 1. Describe and draw a diagram for the 3 programming constructs . [6 ] Variables 1. What is the difference between local and global variables ? [4 ] 2. Describe two advantages of using local variables . [2 ] 3. Describe two advantages of using global variables . [2 ] 4. What is a constant ? Give an example . [2 ] 5. Why is it important to use self-documenting identifiers when programming? [2 ] 6. What is a count ? What is a rogue value ? [2 ] 7.1 - Language Levels Theory Topics 8.2 - Understanding Algorithms
- 8.4 - Validation & Verification - Eduqas GCSE (2020 Spec) | CSNewbs
Learn about the six main validation checks - range, type, length, format, lookup table and presence. Also, discover three verification checks - double entry, proof-reading and check digits. Based on the 2020 Eduqas (WJEC) GCSE specification. 8.5: Validation & Verification Exam Board: Eduqas / WJEC Specification: 2020 + What are validation and verification checks? Validation is a process to check that data is reasonable or sensible before it is accepted . Verification is the process of checking that data is correct after it has been entered. Validation Checks Range Check Checks data is within a certain range . Age: 34 203 Type Check Checks data is a certain data type . Height (in cm): 182 Two metres Format Check Checks data is entered in a certain way . Date of Birth (DD/MM/YYYY) 25/03/2001 25th March 01 Presence Check Checks that data has actually been entered and not left blank . Password: fluffythecat123 Lookup Table A table of acceptable entries , also known as a list . Length Check Checks the length of the input is within a certain amount. Telephone Number 08323877319 07383 Verification Checks Double Entry Typing in the data twice to make sure there were no spelling errors the first time. Password: fluffythecat123 flufythecat123 Proofreading Checking two copies of data to ensure they are exactly the same . Check Digit Similar to a checksum in a data packet, a check digit is calculated on barcodes to ensure the rest of the numbers are correct . Address: 11 Cherry Lane 11 Cherry Road Confirm Q uesto's Q uestions 8.4 - Validation & Verification: 1. Describe each type of validation check and give an example . a. Range Check [ 3 ] b. Type Check [ 3 ] c. Format Check [ 3 ] d. Presence Check [ 3 ] e. Lookup Table (List) [ 3 ] f. Length Check [ 3 ] 2. For the following data, suggest which validation check would be most suitable and why : a. Password [ 3 ] b. Country of Birth [ 3 ] c. Number of Tickets [ 3 ] d. Weight (in kilograms) [ 3 ] 3. Describe three types of verification check and give an example : a. Double Entry [ 3 ] b. Proofreading [ 3 ] c. Check Digit [ 2 ] 8.4 - Sorting & Searching Theory Topics 9.1 - IDE Tools
- OCR CTech IT | Unit 1 | 5.3 - Threats | CSNewbs
Learn about 7 key threats to avoid on the internet, including virus, worm, trojan interception, social engineering and eavesdropping. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 5.3 - Threats Exam Board: OCR Specification: 2016 - Unit 1 What are the 7 threats to computer systems? Phishing Misleading individuals or organisations into giving up sensitive information (such as passwords or bank details), often through the use of emails . Hacking Exploiting weaknesses in a system or network to create, view, modify or delete files without permission. Similar to data theft - illegally removing copies of personal or company data from computer systems. :( Trojan Appears to be a useful or well-known program but when downloaded and installed it secretly gives the attacker a ' backdoor ' to your system. Through this backdoor the attacker can access data without the user knowing. Football 2020 FREE Interception Data packets on a network are intercepted by a third party (e.g. hacker) and copied, edited or transferred to a different location than the intended destination. Eavesdropping Intercepting , in real-time , private communication traffic such as instant messages or video calls . Social Engineering Tricking individuals into giving sensitive information , e.g. by claiming to be from the IT department and asking for their password and username to check for viruses. Virus A virus can replicate itself and spread from system to system by attaching itself to infected files that are then downloaded and opened. Once activated, a virus can modify data or corrupt a system so that it stops working. Q uesto's Q uestions 5.3 - Threats: 1. An IT company is making an information booklet about the different types of online threats . Describe each type of threat: a. Phishing b. Hacking / Data Theft c. Trojan d. Interception e. Eavesdropping f. Social Engineering g. Virus [2 each ] 5.2 - Operational Issues Topic List 5.4 - Physical Security
- Searching & Sorting Algorithms - OCR GCSE (J277 Spec) | CSNewbs
Learn about searching algorithms such as linear and binary search. Also learn about sorting algorithms such as merge, bubble and insertion sorts. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 1.3: Searching & Sorting Algorithms Exam Board: OCR Specification: J277 Watch on YouTube : Linear Search Binary Search Bubble Sort Merge Sort Insertion Sort Key features of a bubble sort: Uses an outer while loop (condition controlled ) to check no swaps have been made . Uses an inner for loop (count controlled ) to repeat through the length of the data set . Uses a flag (a Boolean value ) to track if a swap has been made and uses a temporary value to help correctly swap elements . Linear Search A linear search is the most simple search algorithm. Each data item is searched in order from the first value to the last as if they were all laid out in a line . The list does not have to be in any order before it is searched . This search is also known as a sequential search because the list is searched in a sequence from start to end. For large lists , this search is not very efficient . Binary Search A binary search is a much more efficient searching algorithm as it generally searches through fewer data and is often much quicker - especially for large data sets . In a binary search, the middle point of the data is selected with each iteration and compared to the value being searched for . When the midpoint matches the target value , it as been found and the search can stop. ! ! However there is a prerequisite of using a binary search - the list of data must already be sorted . A prerequisite is a condition that must be satisfied before an algorithm will work correctly . Merge Sort Merge sort is a sorting algorithm based on the idea of ‘divide and conquer ’. A merge sort divides a list into half , again and again until each data item is separate . Then the items are combined in the same way as they were divided , but now in the correct order . When the individual lists are all merged together as one list again, then the data is in order and the algorithm will end . Bubble Sort This algorithm is based on the comparison of adjacent data elements . Data elements are swapped if they are not in the correct order . The algorithm will only stop when a complete iteration through the data is completed with no swaps made . A bubble sort is not suitable for large sets of data . Insertion Sort The list is logically split into sorted values (on the left) and unsorted values (on the right). Starting from the left, values from the unsorted part are checked and inserted at the correct position in the sorted part. This continues through all elements of the list until the last item is reached, and sorted. Insertion sorts are efficient for small data sets but would be slow to sort large sets , compared to alternatives such as a merge sort. Key features of a linear search: A loop is used to check the first value in a list and increment by 1 , checking each value for a match to the target . Reaching the last element of the list without finding a match means the value is not included . Key features of a binary search: A midpoint , lowpoint and highpoint are calculated . A while loop is used to repeatedly compare the midpoint to a target value . The upper half or lower half of the data is ignored if the midpoint does not equal the target . Key features of a merge sort: This algorithm calls itself from within the subroutine (this is known as a recursive algorithm ). It continually splits sublists into a left side and a right side until each sublist has a length of 1 . Watch on YouTube Watch on YouTube Watch on YouTube Watch on YouTube Key features of a insertion sort: Uses an outer for loop (count controlled ) to iterate through each value in the list . Uses an inner while loop (condition controlled ) to find the current value’s correct position in the sorted part of the list . An insertion sort moves ‘ backwards ’ to find the correct position of each value, by decreasing the index within the while loop. Watch on YouTube Q uesto's Q uestions 1.3 - Searching & Sorting Algorithms: Linear Search Explain step-by-step how the number 8 would be found in the following list using a linear search : 12, 5, 3, 2, 8, 19, 14, 6 [4 ] Binary Search Explain step-by-step how the number 2 would be found in the following list using a binary search : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 [6 ] Merge Sort Explain step-by-step how a merge sort would sort the following list of numbers: 4, 8, 5, 1, 3, 6, 7, 2 [6 ] Bubble Sort Explain step-by-step how a bubble sort would sort the following list of numbers: 3, 1, 6, 5, 2, 4 [6 ] Insertion Sort Explain step-by-step how an insertion sort would sort the following list of numbers: 5, 2, 6, 3, 1, 4 [6 ] 1.2 - Designing Algorithms Theory Topics 2.1 - Programming Fundamentals
- Key Stage 3 Python | Turtle | CSNewbs
The final part of a quick guide to the basics of Python aimed at Key Stage 3 students. Learn about importing turtle to command a moving object. Python - #6 - Turtle Import the Turtle The turtle library stores all of the code to create and move an object called a turtle . The turtle library must be imported into your Python program before you can use it to draw lines, shapes and colours . Create a new Python program and save the file as PythonTurtle . Write import turtle as the first line of code. Basic Shapes The turtle can be controlled by writing how many pixels it should travel forward and the angle it should point left or right . Moving Forwards turtle.forward(100) will move the turtle forward by 100 pixels. turtle.forward(200) will move the turtle forward by 200 pixels. When using the left command or the right command, the turtle won't actually move , but it will rotate by the number of degrees that you state. For example, typing turtle.left(90) will point the turtle upwards . Rotating Left & Right Copy the code to the right to make the turtle draw a square. Then try to make: A Rectangle A Triangle A Pentagon A Hexagon Square Rectangle Triangle Pentagon Hexagon Hint: To work out the angles, divide 360 by the number of sides. Using Loops You can use a for loop to repeat code . This is especially helpfully with intricate shapes with many sides. The code below will print a square but in only 3 lines instead of the 8 lines from task 2. This is the number of times the code underneath will be repeated . Change it to a higher number to repeat it more often . Each line after the 'for num in range' line must be indented . Press the tab key once on your keyboard to indent your code. Task 3 - Copy the code above to make the turtle draw a square using a loop. Then try to make: A Heptagon An Octagon A Circle A Pentagram (5-sided Star) Square Heptagon Octagon Circle Pentagram Hint: To work out the angles, divide 360 by the number of sides. Advanced Features Choose a background colour turtle .bgcolor("red") Choose the line size and colour turtle.pensize(6) turtle.color("green") Fill a shape turtle.color("yellow") turtle.begin_fill() (put your turtle's directions in here) turtle.end_fill() Lift the pen turtle.penup() turtle.pendown() Speed up/Slow down the turtle turtle.speed(speed=10) Change the turtle's appearance turtle.shape("turtle") Other options include "circle" and "arrow". Task 4 - Use the code above to make: A blue square on a red background. A yellow triangle on a pink background. Two different coloured circles - not touching each other. Three different shapes of three different colours - not touching each other. Complex Shapes Use everything that you have learned on this page to help you create more complex shapes. You could try: A Flower A Word (like your name - you will need to use the penup() and pendown() commands. A Christmas tree A Landscape (green ground, blue sky, yellow sun) <<< Selection
- 5.1 - Languages & Translators - OCR GCSE (J277 Spec) | CSNewbs
Learn about the two types of language levels - high level languages and low level languages , as well as the use of interpreters and compilers. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 5.1: Languages & Translators Exam Board: OCR Specification: J277 Watch on YouTube : High-Level & Low-Level Languages Translators (Compiler & Interpreter) There are two types of programming languages used within computer systems: High-Level Languages Why do programmers use high-level languages? H igh-level programming languages use code written in a way that is similar to a natural human language , such as English, making it easier to understand and use the language. Using high-level languages leads to fewer errors and allows for more powerful and complex commands compared to low-level languages. However, a high-level language must be translated into machine code (binary) before it can be run, as high-level languages cannot be executed directly by the CPU . Popular high-level languages: PYT HON C++ Ja v a Visual Basic Low-Level Languages Low-level languages do not closely resemble a natural human language , making it harder for humans to understand and write in. Low-level languages are used when a program must be executed quickly or when programmers need to write code that interacts directly with the hardware , such as device drivers. There are two types of low-level language : Machine Code This is the pure binary code that computers can directly process and execute . It is extremely tedious and difficult for humans to understand and write machine code. However, machine code can be used when a programmer needs to perform a very specific command that can't be done in a high-level language. Machine code will be executed faster than high-level programs because it is already in a format the CPU can execute and does not need to be translated . 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 0101 0100 1010 1010 1010 1010 1111 1110 0010 1001 0100 1001 0010 0111 0111 0101 0011 1010 1000 0101 0110 0111 0000 1010 1010 0011 1101 1001 0010 1101 0010 0100 1001 0011 1010 1001 0101 0101 0010 0101 0111 0101 0101 1000 1011 0111 Assembly Language Assembly language uses specialised command mnemonics to perform actions . See the Assembly Language section in the programming tab for a list of mnemonics such as INP , OUT and HLT . Assembly language is preferred by many programmers over machine code because it is easier to understand and spot errors . It is faster to execute than high-level languages and, like machine code, can be used to directly control the CPU . INP STA Number1 OUT HLT Number1 DAT Translators A translator changes (translates) a program written in one language into another language (usually machine code ). There are two main types of translator : Interpreter An interpreter converts high-level language one line at a time into machine code and executes it. Compiler A compiler converts high-level language into machine code for execution at a later time. The entire program is converted at once . PYT HON PYT HON 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 Interpreters vs Compilers Interpreter Compiler Execution Method: An interpreter translates source code (high level code) into machine code one line at a time . Execution Speed: An interpreter is slower than a compiler because the code must be reinterpreted each time the program is run. Complexity: Interpreters are smaller, simpler programs . Error Reporting: In error reporting, the interpreter would encounter the errors and report it to the user immediately and stops the program from running. Repetition: Interpreted programs can be edited and run without translating the whole program . Interpreters must reinterpret the program every time it is run. Execution Method: A compiler translates all the source code (high level code) into machine code in one go . A compiler produces an executable file that will run on other machines without the compiler needing to be installed. Execution Speed: Compilers can produce much more efficient code than interpreters making the compiled programs run faster . Complexity: Compilers tend to be large complex programs . Error Reporting: The compiler would analyse the entire program , taking note of where errors have occurred and record them in an error file . Repetition: Compilation requires analysis and the generation of the code only once , whereas interpreters must re-interpret each time. However, compiled programs have to be re-compiled after any changes have been made. x1 ∞ x1 Q uesto's Q uestions 5.1 - Languages & Translators: 1a. Describe three reasons why programmers use high-level languages . [ 3 ] 1b. Explain one limitation of using high-level languages . [2 ] 2a. Describe a key difference between low-level languages and high-level languages . [ 2 ] 2b. Describe when a low-level language would be used instead of a high-level language . [2 ] 2c. Describe an advantage and a disadvantage of writing directly in machine code . [2 ] 2d. Describe what assembly language is. Give one benefit to using assembly language instead of machine code and one benefit to using it instead of a high-level language . [3 ] 3. Compare high-level and low-level languages by stating which is: a. Easier to understand [ 1 ] b. Requiring translation [ 1 ] c. Quicker to execute [ 1 ] 4. Compare interpreters and compilers for each of the following features : a. Execution Method b. Execution Speed c. Complexity d. Error Reporting e. Repetition [ 10 total ] 4.1 - Boolean Logic Theory Topics 5.2 - IDE







