Search CSNewbs
304 results found with an empty search
- 1.2 - Designing Algorithms - OCR GCSE (J277 Spec) | CSNewbs
Learn about designing algorithms including constructing pseudocode and flowcharts. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). Exam Board: OCR 1.2: Designing Algorithms Specification: J277 Watch on YouTube : Inputs, Processes & Outputs Structure Diagrams Pseudocode Flowcharts Writing Code in Exams Trace Tables What is an algorithm? An algorithm is a set of instructions , presented in a logical sequence . In an exam you may be asked to read and understand an algorithm that has been written. To prove your understanding you may be asked to respond by actions such as listing the outputs of the algorithm, correcting errors or identifying an error within it. Programmers create algorithm designs as a method of planning a program before writing any code. This helps them to consider the potential problems of the program and makes it easier to start creating source code. There are two main methods of defining algorithms are pseudocode and flowcharts . In exams , OCR will display algorithms in their own 'OCR Exam Reference Language '. Visit the Python section of CSNewbs ---> OCR Exam Reference Language Below is a list of all of the code concepts from the OCR J277 GCSE specification that you need to know , presented in OCR Exam Reference Language (OCR ERL ), which is how code will be presented in the paper two exam . The code below is NOT Python . There are several differences between OCR ERL and real high-level languages like Python or Java , especially in the 'String Handling ' section and with for loops . In an exam, you can write in OCR ERL or a programming language you have learnt. All code-related videos in the CSNewbs YouTube series for Paper 2 show both OCR ERL and Python side-by-side . Basic Commands Annotation // Comments are written using two slashes Assignment name = "Harold" age = 49 Constants and Global Variables constant tax = 15 global name = "Admin" Input / Output name = input ( "Enter your name") print ("Transaction Complete") Casting str (29) int ("102") float (30) bool ("False") Random Number number = random (1,100) Selection Selection (if - then - else) if firstname == "Steven" then print("Hello" + firstname) elif firstname == "Steve" then print("Please use full name") else print("Who are you?") end if Selection (case select) switch day: case “Sat”: print(“It is Saturday”) case “Sun”: print(“It is Sunday”) default : print(“It is a Weekday”) endswitch Iteration Iteration (for loop) for i = 1 to 10 step 1 input item next i Iteration (while loop) while firstname ! = "Steven" firstname = input("Try again:") endwhile Iteration (do while loop) do firstname = input("Guess name:") until firstname == "Steven" String Handling Length of a String word = "dictionary" print(word.length ) outputs 10 Substrings word = "dinosaurs" print(word.substring (2,3)) outputs nos print(word.left (3)) outputs din print(word.right (4)) outputs aurs Concatenation name = "Penelope" surname = "Sunflower" print(name + surname) String Cases phrase = "The Cat Sat On The Mat" print(phrase .lower ) print(phrase .upper ) ASCII Conversion ASC ("C") returns 67 CHR (100) r eturns "d" File Handling File Handling - Reading Lines file1 = open ("Customers.txt") while NOT file1.endOfFile() print(file1.readLine() ) endwhile file1.close() File Handling - Writing to a (New) File newFile ("paint.txt") file2 = open ("paint.txt") paint = input("Enter a paint colour:") file.writeLine (paint) file2.close() Arrays Declare Array array names[3] array names = "Ella", "Sam", "Ali" Declare 2D Array array grid[4,5] Assign Values names[2] = "Samantha" grid[1,3] = "X" More Programming Keywords Connecting strings together using the + symbol is called concatenation . Extracting certain parts of a string (e.g. using .substring() ) is called slicing . An if statement within an if statement or a loop within a loop is called nesting . Flowcharts A flowchart can be used to visually represent an algorithm. It is more likely you will need to be able to interpret a flowchart rather than draw one. The flowchart symbols are: The terminator symbol is also known as a terminal . Algorithm Examples Below are two different methods for representing the same algorithm - a program to encourage people to buy items cheaply at a supermarket. The program allows the price of items in a supermarket to be entered until the total reaches 100. The total price and the number of items entered are tracked as the program loops. Once the total reaches 100 or more, an if statement checks how many items have been entered and a different message is printed if there are 20 or more items, 30 or more items or less than 20 items. Pseudocode // This is a program to see how many items you can buy in a supermarket before you spend over £100} total = 0 itemsentered = 0 while total < 100 itemprice = input ("enter the price of the next item") total = total + itemprice itemsentered = itemsentered + 1 endwhile if itemsentered >= 20 then print ("You are on your way to saving money.") elif itemsentered => 30 then print ("You're a real money saver.") else print ("Look for better deals next time.") endif Flowchart Reading Algorithms In an exam you may be asked to read an algorithm and prove your understanding , most commonly by listing the outputs . Start from the first line and follow the program line by line , recording the value of variables as you go . When you encounter a for loop , repeat the indented code as many times as stated in the range . Example Algorithm: procedure NewProgram() maxvalue = input() for i = 1 to maxvalue output (i * i) ??????? print("program finished") endprocedure Example Questions: 1. List the outputs produced by the algorithm if the 'maxvalue' input is 5 . 2. State the code that has been replaced by '???????' and what the code's purpose is. Example Answers: 1. Outputs: 1 4 9 16 25 program finished 2. Missing Code: next i Purpose: Moves the loop to the next iteration. Watch on YouTube Structure Diagrams Structure diagrams display the organisation (structure ) of a problem in a visual format , showing the subsections to a problem and how they link to other subsections . The noughts and crosses structure diagram below has subsections in light yellow. Each subsection could be coded by a different person . Structure diagrams are different to flowcharts (those show how data is input, processed and output within a program or system). You may be asked in an exam to draw or fill in a simple structure diagram . Trace Tables Trace tables are used to track the value of variables as a program is run . They can be used to manually track the values in order to investigate why the program isn't working as intended . Each row in the trace table represents another iteration . Each column stores the value of a variable as it changes. See below how the trace table is updated for the simple algorithm on the left. num1 = 2 num2 = 5 for i = 1 to 3 output (num1 + num2) num2 = num2 - 1 next i print("complete") For most algorithms, not every variable will be updated in each iteration . Values may not be entered in the order of the trace table either. For example, each iteration outputs num1 + num2 and then decreases the value of num2 by 1. Q uesto's Q uestions 1.2 - Designing Algorithms: 1. What is the definition of an algorithm ? Name two ways an algorithm can be designed . [ 3 ] 2. Using a high-level programming language such as Python , or the OCR Exam Reference Language , write an algorithm that inputs 6 decimal numbers and outputs the total , largest , smallest and average values. [ 8 ] For example, entering 3.1 , 5.3 , 2.3 , 5.4 , 2.9 and 4.4 would output 23.3 (total), 5.4 (largest), 2.3 (smallest) and 3.9 (average). 3. Draw and label the flowchart symbols . [ 6 ] 4. What is the purpose of a structure diagram ? [ 2 ] 5. Create a trace table for the NewProgram() algorithm in the Reading Algorithms section on this page. [ 7 ] 1.1 - Computational Thinking Theory Topics 1.3 - Searching & Sorting
- 4.1 - Number Systems - Eduqas GCSE (2020 Spec) | CSNewbs
Learn about how to convert between the denary (decimal), binary and hexadecimal number systems. Based on the 2020 Eduqas (WJEC) GCSE specification. 4.1: Number Systems Exam Board: Eduqas / WJEC Specification: 2020 + What is binary? By now you should know that computer systems process data and communicate entirely in binary . Topic 1.4 explained different binary storage units such as bits (a single 0 or 1), nibbles (4 bits) and bytes (8 bits). Binary is a base 2 number system. This means that it only has 2 possible values - 0 or 1 . Because binary is a base 2 number system, binary numbers should be written out with a 2 after them, like this: 10101002 What is denary? Denary (also known as decimal ) is the number system that you've been using since primary school. Denary is a base 10 number system. This means that it has 10 possible values - 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 . Because denary is a base 10 number system, denary numbers should be written out with a 10 after them, like this: 165 10 How to convert from binary to denary: How to convert from denary to binary: What is hexadecimal? Hexadecimal is a base 16 number system. This means that it has 16 possible values - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F . Because hexadecimal is a base 16 number system, hexadecimal numbers should be written out with a 16 after them, like this: 6E16 Hexadecimal is used as a shorthand for binary because it uses fewer characters to write the same value . This makes hexadecimal less prone to errors when reading or writing it , compared to binary. For example, 1001111010112 is 9EB16 . Hexadecimal only uses single-character values. Double-digit numbers are converted into letters - use the table on the right to help you understand. How to convert from binary to hexadecimal: How to convert from hexadecimal to binary: Converting from denary to hexadecimal / hexadecimal to denary To convert from denary to hexadecimal or the other way round you must convert to binary first . Denary > Binary > Hexadecimal Hexadecimal > Binary > Denary Use the videos on this page if you need help converting to or from binary. The most common number systems question in exams are from denary to hexadecimal or from hexadecimal to denary so make sure that you practice these conversions. Q uesto's Q uestions 4.1 - Number Systems: 1. Explain why hexadecimal numbers are used as an alternative to binary . Use an example . [ 3 ] 2. Convert the following values from binary to denary : a. 00101010 2 b. 11011011 2 c. 01011101 2 d. 11101110 2 e. 01011111 2 [1 each ] 3. Convert the following values from denary to binary : a. 35 10 b. 79 10 c. 101 10 d. 203 10 e. 250 10 [1 each ] 4. Convert the following values from binary to hexadecimal : a. 11110101 2 b. 01100111 2 c. 10111010 2 d. 10010000 2 e. 11101001 2 [1 each ] 5. Convert the following values from hexadecimal to binary : a. C2 16 b. 8A 16 c. DE 16 d. 54 16 e. F7 16 [1 each ] 6. Convert the following values from denary to hexadecimal : a. 134 10 b. 201 10 c. 57 10 d. 224 10 e. 101 10 [1 each ] 7. Convert the following values from hexadecimal to denary : a. 32 16 b. A5 16 c. 88 16 d. C0 16 e. BE 16 [1 each ] Watch on YouTube Watch on YouTube Watch on YouTube Watch on YouTube Click the banners above to try self-marking quizzes (Google Form) on these topics. Denary to Binary: Binary to Denary: Binary to Hexadecimal: Hexadecimal to Binary: 3.9 Protection Against Threats Theory Topics 4.2 - Signed Binary
- 2.4 - Programming Languages | OCR A-Level | CSNewbs
Learn about programming paradigms such as procedural language (e.g. Python), assembly language (including Little Man Computer) and object-oriented programming (OOP) language (e.g. Java). Methods of memory addressing (immediate, direct, indirect and indexed) are also covered. Based on the OCR H446 Computer Science A-Level specification. Exam Board: OCR A-Level 2.4 - Types of Programming Language Specification: Computer Science H446 Watch on YouTube : Programming Paradigms Procedural Language Assembly Language Addressing Modes Little Man Computer Object-Oriented Language Programming paradigms are different approaches to writing and structuring code to solve problems . The procedural paradigm focuses on step-by-step instructions and the use of functions to organise tasks . The assembly paradigm operates at a low level , giving direct control over hardware through processor-specific instructions . The object-oriented paradigm models programs around objects that combine data ( attributes ) and behaviour ( methods ), promoting modular and reusable design . Procedural Language A procedural programming language organises code into reusable blocks ( procedures or functions ), which perform specific tasks in a step-by-step manner . It focuses on a clear sequence of instructions that operate on data, often using variables , loops and conditionals . Examples include Python , C , Pascal and BASIC . These languages are commonly used for software development , data processing and teaching programming fundamentals as they emphasise logical structure and modular design . YouTube video uploading soon Assembly Language Assembly language is a low-level programming language that uses short , readable codes called mnemonics to represent machine-level instructions executed by the CPU . Each command in assembly corresponds closely to a specific hardware operation , making it highly efficient but difficult to write and maintain . It is mainly used for embedded systems , device drivers and performance-critical tasks where direct control of hardware is required . For the OCR A-Level course , you must understand and be able to write code using the 11 mnemonics of Little Man Computer ( LMC ), which is an educational form of assembly language . Modes of Addressing Memory An addressing mode in assembly language defines how the CPU should locate the data (operand ) needed for an instruction (opcode ). It tells the processor whether the data is stored directly in the instruction , in memory , or needs to be calculated using an address or register . There are four main types : Immediate addressing : The operand contains the actual data to be used , rather than a memory address. Direct addressing : The operand contains the memory address where the required data is stored . Indirect addressing : The operand contains an address that points to another memory location holding the actual data . Indexed addressing : The operand provides a base address that is adjusted by the value in an index register to find the final memory address of the data . YouTube video uploading soon YouTube video uploading soon YouTube video uploading soon Object-Oriented Language An object-oriented programming ( OOP ) language organises code around objects , which combine data ( attributes ) and behaviour ( methods ) into reusable units . Key features of OOP : Classes are templates from which objects are created . Classes define both attributes (data ) and methods (functions or behaviours ). Encapsulation allows data to be protected by making attributes private and providing controlled access through public methods . Inheritance enables a class to reuse or extend the attributes and methods of a parent class , promoting the reuse of code . Polymorphism allows methods or attributes to behave differently depending on the object or class that uses them . Examples of OOP languages include Java , Python , C++ and C# . These languages are widely used for large-scale software development , game development and graphical user interfaces , where modularity and code reuse are crucial . YouTube video uploading soon YouTube video uploading soon This page is under active development. Check here for the latest progress update. Q uesto's K ey T erms Programming Paradigms: procedural language, assembly language, object-oriented language Procedural Language: input, output, comments, variables, casting, count-controlled iteration, condition-controlled iteration, logical operators, selection, string handling, subroutines, arrays, files Assembly Language: Little Man Computer, INP, OUT, LDA, STA, ADD, SUB, HLT, DAT, BRA, BRP, BRZ Modes of Addressing Memory: immediate, direct, indirect, indexed, index register, opcode, operand Object-Oriented Language: class, method, attribute, encapsulation, inheritance, polymorphism, instantiation, constructor method, get method, set method D id Y ou K now? Python was named after the 1970s British comedy group ' Monty Python ', not the snake . Guido van Rossum created Python in the late 1980s during his Christmas holidays as a ' hobby project '. 2.3 - Software Development A-Level Topics 3.1 - Compression & Encryption
- 6.1a - Impacts of Technology - OCR GCSE (J277 Spec) | CSNewbs
Learn about ethical, legal, cultural, privacy and environmental impacts of digital technology. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 6.1a: Impacts of Technology Exam Board: OCR Specification: J277 Watch on YouTube : Impacts of Technology What are the issues created by technology? As the use of computers and technological devices continues to rise every year, this increase brings with it a range of different types of issues . Categories of issues described on this page include: Cultural issues Environmental issues Ethical issues Legal & Privacy issues Cultural Issues Culture relates to society and how different parts of the world vary in terms of computer and internet usage . The Digital Divide This term relates to the gap between those people who have access to modern digital technology (such as computers and the internet) and those who have limited access . 'Limited access' could be devices at home or shared devices or having lower-performance (cheaper) computers and low-speed internet connections. The digital divide can be seen in different ways , such as: People in cities vs. People in rural areas . Younger people vs. Elderly people. Developed countries vs. Developing countries. The digital divide is an important ethical issue because digital technologies have led to numerous international benefits including boosted growth , improved product delivery , enhanced communication and increased opportunities . However, this impact is uneven and these positive impacts are mostly occurring in technologically-advanced regions such as North America , Western Europe and Japan . Regions like some nations in Africa and Central Asia have limited digital infrastructure and government instability , leading to poor internet speeds , high costs and limited resources . Discussion Points: What do you think can be done to bridge the digital divide? Whose job is it to bridge the gap? Who will pay for the technology? Changes to Work The internet , the development of new technologies such as cloud storage and increased video communication have transformed the way that many businesses operate across the world. Staff may be able to work from home or access documents collaboratively outside of the traditional workplace, such as cafes or on public transport. Some jobs have moved abroad to save costs, such as help centres for online issues. Tasks can be outsourced to freelancers in other countries where people are content to be paid less for their time and services. For example, some companies will hire temporary web developers from countries such as India to work for them for a lower salary than local workers. Another change to work that technology has brought is the loss of jobs , especially low-skilled jobs such as factory workers that have seen their roles replaced by technology and automation . However, technology has also created millions of new jobs , including installing and maintaining the machines that replace other roles. Environmental Issues Environmental issues concern the natural world and the negative effects of producing , using and discarding computer systems and devices. Energy and Material Consumption In the past 30 years, the number of technological devices has increased astronomically and thousands of new devices are manufactured each day . These devices need to be assembled using a range of materials , including plastics , metals and some rarer elements and need a considerable amount of electrical power to run. Certain systems like web servers and data centres must be powered on all day , every day, which uses a large amount of energy . Pollution and Waste Generating the electricity to power computers creates pollution - an average PC could require up to 50% more energy per year than a fridge. Computers are difficult to recycle and discarded components can lead to land, water and air pollution due to harmful materials , such as lead and mercury , leaking into the environment. Smartphone trends are also negative for the environment as new devices are released yearly , with minor upgrades that people buy to appear fashionable and up-to-date. To lessen the environmental impact, people should reuse and recycle their devices. Ethical Issues Ethics relates to what is considered right or wrong . Often this is subjective - people may have differing opinions on the issue. Drones Uses of drones: Filming and photography for television, movies and special events. Monitoring pollution levels in the atmosphere. Tracking and monitoring wildlife , such as rhino populations in Africa. Disaster zone response , such as searching for survivors following an earthquake. Delivery companies are developing drones to quickly deliver goods across cities. Drones are used by the military to target sites in other countries, such as American soldiers deploying surveillance drones in Syria. Discussion Points: Should you need a licence to buy and fly a drone? Should drones be used to monitor the public? Like flying CCTV? Should drones be used to deliver items? Like Amazon packages? If a drone hits a plane and it crashes, what should the punishment be? A drone is an unmanned aerial vehicle (UAV ) that is remotely operated and can be used for a wide range of purposes. Self-Driving Cars Self-driving cars (also known as autonomous vehicles ) are currently in the development and testing stage with companies like Tesla and Amazon. Benefits of self-driving cars include: In theory, driving will be safer because cars are less likely to make mistakes that humans do and they can’t become distracted or tired . Self-driving cars should be more fuel-efficient because they take the most direct route to destinations and do not get lost. ‘Drivers’ in the car can perform other tasks instead of driving, such as work or planning. Autonomous vehicles could include trucks and vans to automate the delivery and freight industries . Trucks could drive overnight to deliver goods whereas currently, human drivers must take breaks every few hours. Drawbacks of self-driving cars include: Cars could still crash as code and software processes may fail. The technology is still in development and will be very expensive for the first few years when self-driving cars are available to purchase. Jobs may be lost such as delivery and truck drivers whose vehicles are equipped with self-driving technology. Other industries like motorway services and hotels may also be affected. Discussion Points: Would you trust a car to drive itself? Who is to blame if a self-driving car crashes? The car maker? The people in the car? The software writers? What should happen to the people whose jobs are taken by self-driving vehicles? Artificial Intelligence Artificial Intelligence (AI ) is the act of computers replacing humans to analyse data and make decisions . In recent years AI has become more common in the home and on devices like smartphones; assistants such as Siri and Alexa are prime examples of modern home AI. AI Chatbots like ChatGPT have become more popular in recent years but have lead to issues such as plagiarism , misinformation and breaking copyright laws . The weather today is cloudy. Benefits of AI include: Processes are sped up as computers can analyse large amounts of data much quicker than a human. AI can be used when a human is unavailable , such as using a symptom checker on the internet for a minor illness rather than booking and waiting for a doctor. Repetitive or time-consuming tasks can instead be completed by a computer , such as searching and sorting scientific data or generating ideas , images or audio from a prompt . Drawbacks of AI include: AI can store and process a lot of personal data , especially personal assistants like Alexa which are always listening for ‘wake words’. This data can be viewed by the company that develops it and could be hacked by attackers. AI is programmed by humans and mistakes in code could have disastrous consequences if the AI is used to make important decisions , such as military deployment. AI GPT tools like ChatGPT can give incorrect results , may use copyrighted material in their response and students may use it to submit work that is not their own . Discussion Points: If a robot harms a human who is to blame? The robot? The programmer? The manufacturer? Us? Would you trust a walking, talking robot assistant in your home? Should ChatGPT be banned in schools or can it be helpful? Should AI make decisions for us? Legal & Privacy Issues Legal and privacy issues regard laws that have been introduced by the UK government to protect data, systems and networks from unauthorised access . See 11.2 for explanations about important computing legislation in the UK. Loss of Privacy & Hacking There has been a lot of criticism in the last few years about how internet companies and governments are using personal data to invade privacy and track civilians . Facebook was involved in a scandal with using personal data for reasons that were not the original intention. In reverse, WhatsApp and Apple have been criticised for encrypting messages sent by terrorists that police have been unable to track and read. Every week a new company seems to announce that its data has been hacked . Attackers are constantly using botnets and infected systems to crack poorly secured databases and attempting to phish individuals for usernames and passwords. In the past few years, major hacking breaches include Sony, Yahoo and TalkTalk. Discussion Points: Should the UK government be able to see the websites you have visited in the last year? What should happen if a major company is hacked and bank details are stolen? Should they be fined? Pay customers? Prison? Should WhatsApp allow authorities to access encrypted messages? What if they know a terrorist is using it to communicate? Should the UK debate privacy laws before they go into place? Online Crime Unlawfully obtaining personal information and using it for identity theft or fraud . Harassment and threatening others on social media or private messages; blackmail . Cyber attacks are more common - see 3.8 for information about DOS attacks , IP spoofing , SQL injection and more. Sharing copyrighted material such as television programmes, music and video games. Distributing prohibited material such as drugs or weapons on the dark web. See 6.1b for explanations about different laws that have been created to tackle online crime . The increased popularity of the internet and the rising number of users has led to a wave of online crime , taking many different forms, including: Q uesto's Q uestions 6.1a - Impacts of Technology: Cultural Impacts 1a. What is the digital divide ? [ 2 ] 1b. Describe 2 examples of how the digital divide can be seen . [ 2 ] 2. Describe in detail 3 ways that technology has changed the way people work . [9 ] Environmental Impacts 1. Describe the different ways that the increasing use of technology negatively impacts the environment . [ 5 ] Ethical Impacts 1a. What is a drone ? [1 ] 1b. Make a list of all of the positive impacts and the negative impacts of using drones . You should have at least 3 on each side. [ 6 ] 2. Describe 2 benefits of using self-driving cars and 2 negative consequences . [4 ] 3. Describe how artificial intelligence can be used for good . [ 4 ] Legal & Privacy Impacts 1. A hack on a bank has occurred. Describe what you think the impacts would be on the following groups of people: a. The customers . b. The bank managers . c. The general public . [ 6 ] 2. Describe 4 different types of online crime . [ 8 ] 5.2 - Utility Software Theory Topics 6.1b - Legislation
- 4.7 - Sound Representation - Eduqas GCSE (2020 Spec) | CSNewbs
Learn about how sounds are represented in a computer system including how analogue sound waves are converted into binary. Also, learn about sample rate, bit depth and metadata. Based on the 2020 Eduqas (WJEC) GCSE specification. 4.7: Sound Representation Exam Board: Eduqas / WJEC Specification: 2020 + Converting Analog Sound to Binary To store sound on a computer analog sound waves must be converted in to digital data ( binary ). The sound is sampled using an ADC (Analog to Digital Convertor) and stored as a binary value (such as 01010011) called a sample . 0010 1011 0101 0101 Analog sound wave ADC (Analog to Digital Converter) Binary sample Sampling an Analog Sound Wave Digital sampling is discrete (separate) and not continuous like analog waves. To get the highest quality sound, many samples are taken to recreate the analog wave as closely as possible . Sample Rate The sample rate is the number of samples taken per second . It is measured in kilohertz (kHz), for example CD quality is 44.1kHz (44,100 samples per second). The higher the sample rate , the better the audio quality as the digital data more closely resembles an analog wave . However, higher sample rates result in larger file sizes because more data is stored for each individual sample. A low sample rate will result in a low-quality sound because the digital data does not closely resemble the original analog wave . A higher sample rate will result in a higher-quality sound because the digital data more closely resembles the original analog wave . Improving Audio Quality Bit Depth Bit Rate The bit rate is defined as the amount of audio data processed per second . It is measured in kilobytes per second (kbps ). The bit rate is calculated by multiplying the sample rate and bit depth . Because the bit rate is the measure of the sample rate and bit depth multiplied together, the higher the bit rate the higher the quality of the sound . The bit depth is the number of bits available to represent each sample . For example, a sample with a bit depth of 4 could be 0101 or 0111 or 1010. A sample with a bit depth of 8 could be 01010110 or 1010110 or 11001111. A common bit depth is 16 bits . The higher the bit depth , the more bits are available to be used for each sample. Therefore the quality is often higher as the wave more closely resembles an analog wave . The file size will also be larger if the bit depth is higher, as each sample stores additional bits . Example: A short audio sample has a bit depth of 4 and a sample rate of 10 samples per second . The clip is 15 seconds long . Calculate the bit rate by multiplying the sample rate and bit depth : 4 bits x 10 = 40 bits . Now that is the correct data for one second. Multiply the bit rate by the number of seconds in the file: 40 x 15 = 600 bits . To convert the answer from bits to bytes , divide by 8 . 600 bits ÷ 8 = 75 bytes . Calculating File Size Metadata for Sound Files Music libraries such as Apple Music or Spotify store a huge amount of metadata on each song. Metadata is additional data about a file such as: Artist Title / Track Title Product / Album Title Track Number Date Created / Year Genre Comments Copyright Software Type Duration File size Bit rate Sampling rate Channels Volume Q uesto's Q uestions 4.7 - Sound Representation: 1. Explain how an analog sound wave is converted into a binary sample . [ 2 ] 2a. What is a sample rate ? [1 ] 2b. Explain two ways an audio file will be affected if the sample rate is increased . [4 ] 3a. What is bit depth ? [2 ] 3b. Explain two ways an audio file will be affected if the bit depth is increased . [4 ] 3c. Explain what the bit rate is. [ 2 ] 4 . An audio sample has a bit depth of 8 , a sample rate of 10 and it is 12 seconds long . What is the file size in bytes ? [ 2 ] 5a. What is metadata ? [ 2 ] 5b. State four different types of metadata for audio files . [4 ] low bit rate = lower quality high bit rate = higher quality Converting Analog Sound to Binary 1 4.6 Graphical Representation Theory Topics 4.8 - Compression
- 1.3.2 - Software Categories | F160 | Cambridge Advanced National in Computing | AAQ
Learn about the purpose, characteristics, advantages, disadvantages, examples and client requirements of application software categories including open, closed, shareware, freeware and embedded software. Resources based on Unit F160 (Fundamentals of Application Development) for the OCR Cambridge Advanced National in Computing (H029 / H129) AAQ (Alternative Academic Qualification). Qualification: Cambridge Advanced National in Computing (AAQ) Unit: F160: Fundamentals of Application Development Certificate: Computing: Application Development (H029 / H129) 1.3.2 - Application Software Categories Watch on YouTube : Open Software Closed Software Shareware Freeware Embedded Software There are five application software categories you need to know : Open Closed Shareware Freeware Embedded For each software category you need to know : Its purpose and common characteristics . The types of devices the software may be used on. The advantages and disadvantages of using the software. How client requirements affect the selection of that software. Application Categories Open Software Closed Software Open (usually known as open-source ) software is developed to be freely accessible and allow users to view , modify and distribute the source code . Its purpose is to promote collaboration and customisation when developing software . Closed (or closed-source or proprietary ) software is developed and distributed by a company or individual who owns the source code . The purpose is to maintain control , generate profit and ensure a consistent user experience . Shareware Shareware is closed software that is distributed for free on a trial basis , often with limited features or time restrictions . The purpose is to let users try before they buy , encouraging them to later purchase the full version . Freeware Freeware is closed software that is completely free to use , usually without restrictions like time limits or limited features , but still owned by a developer or company . The purpose is to provide software for free while retaining control over its code and distribution . Embedded Software Embedded software is designed to run on specific hardware and perform dedicated tasks . It is usually built into devices that are not traditional computers (like washing machines or microwaves ), allowing those devices to function efficiently and potentially automatically . Q uesto's Q uestions 1.3.2 - Application Software Categories: 1. Summarise the five categories of application software in two sentences each . [5 ] 2. An independent video game company has made a short game with just three levels. Justify which application software category they should use and why . [4 ] 3. Describe the advantages and disadvantages of using embedded software . [ 4 ] WinRAR is a shareware compression tool with a 40-day free trial , but it never actually locks users out. Since 1995 , WinRAR has been downloaded an estimated 500 million times . D id Y ou K now? 1.3.1 - Application Types Topic List 1.3.3 - Application Software Types
- Malware | Key Stage 3 | CSNewbs
Learn about different forms of malware including virus, worm and trojan. Learn about the different ways that malware can infect a computer system. Malware Malware is any type of harmful program that seeks to damage or gain unauthorised access to your computer system. Part 1: SiX Types of Malware Virus A virus can replicate itself and spread from system to system by attaching itself to infected files . A virus is only activated when opened by a human . Once activated, a virus can change data or corrupt a system so that it stops working . Trojan A trojan is a harmful program that looks like legitimate software so users are tricked into installing it . A trojan secretly gives the attacker backdoor access to the system . Trojans do not self replicate or infect other files. Ransomware Ransomware locks files on a computer system using encryption so that a user can no longer access them. The attacker demands money from the victim to decrypt (unlock) the data . ? ? Attackers usually use digital currencies like bitcoin which makes it hard to trace them. Spyware Spyware secretly records the activities of a user on a computer. The main aim of spyware is to record usernames, passwords and credit card information . All recorded information is secretly passed back to the attacker to use. Keylogger A keylogger secretly records the key presses of a user on a computer. Data is stored or sent back to the attacker. The main aim of a keylogger is to record usernames, passwords and credit card information . Keyloggers can be downloaded or plugged into the USB port . Worm A worm can replicate itself and spread from system to system by finding weaknesses in software . A worm does not need an infected file or human interaction to spread. A worm can spread very quickly across a network once it has infiltrated it. Part 2: Four ways malware cAN infect your system 1. A ccidentally downloading an infected file from an insecure website . 2. Phishing emails - clicking on attachments or links in spam emails . 3. Installing malware from a physical device, e.g. USB stick . 4. Self-replicating malware , such as worms , spreading across a network . Phishing & Staying Safe
- Unit F160 - Fundamentals of Application Development - Cambridge Advanced National in Computing | CSNewbs
Navigate between all Unit F160 (Fundamentals of Application Development) topics in the OCR Cambridge Advanced National in Computing (AAQ) specification. Qualification: Cambridge Advanced National in Computing (AAQ) Unit: F161: Developing Application Software Certificate: Computing: Application Development (H029 / H129) Unit F161: Developing Application Software These pages are based on content from the OCR Cambridge Advanced National in Computing (AAQ) specification . Unit F161 YouTube Playlist Topic 1: Application Software Considerations 1.1 - Application Platforms 1.2 - Devices 1.3 - Storage Locations This unit will be updated in summer 2026. Check here for the latest progress update. Topic 2: Data & Flow in Application Software 2.1 - Data Formats & Types 2.2 - Data Flow 2.3 - Data States Topic 3: API & Protocols 3.1 - Application Programming Interfaces (API) 3.2 - Protocols Topic 4: Application Software Security 4.1 - Security Considerations Topic 5: Operational Considerations 5.1 - Testing 5.2 - Types of Application Software Installation 5.3 - Policies Topic 6: Legal Considerations 6.1 - Legal Considerations
- Python | 8a - Using Lists | CSNewbs
Learn how to create and use lists in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 8a - Using Lists Lists A list is a temporary data structure . Any changes made to the list while the program is running will not be saved the next time it is run . Data can be added to and removed from lists so they can change in size (unlike an array which is fixed and not used in Python). It is important to note that each data element in a list has an index so that it can be specifically referenced (to delete it for example) and that indexes start at 0 . A list of the rainbow colours in order would start at 0 like this: Creating & Printing Lists Lists use square brackets in Python. Separate list items with commas . Strings must use speech marks and integers do not use speech marks. people = [ "Alan" , "Jesse" , "Max" , "Jack" ] years = [ 2010, 2019, 2001, 2016 ] There are many different ways to print items from a list depending on how you want it to look . Print all items on one line Type the list name into a print command to output the complete list . Typing an asterisk * before the list name removes punctuation . cities = [ "Shanghai" , "Sao Paolo" , "Bishkek" , "Asmara" ] print (cities) cities = [ "Shanghai" , "Sao Paolo" , "Bishkek" , "Asmara" ] print (*cities) ['Shanghai', 'Sao Paolo', 'Bishkek', 'Asmara'] Shanghai Sao Paolo Bishkek Asmara Print each item on a separate line To print a list line-by-line use a for loop to cycle through each item. 'city ' is just a variable name and can be replaced with the traditional 'i ' or anything relevant to the context, such as 'colour ' in a list of colours or 'name ' in a list of people. cities = [ "Shanghai" , "Sao Paolo" , "Bishkek" , "Asmara" ] for city in cities: print (city) Shanghai Sao Paolo Bishkek Asmara Print separated items on one line To print separated data elements on the same line then you can use the end command which defines what should go after each item . The example below uses slashes but end = " , " would add comma and space between each element. cities = [ "Shanghai" , "Sao Paolo" , "Bishkek" , "Asmara" ] for city in cities: print (city, end = " / " ) Shanghai / Sao Paolo / Bishkek / Asmara / Print specific list items To print an element with a certain index , put the index in square brackets . But remember that the index starts at 0 not 1. cities = [ "Shanghai" , "Sao Paolo" , "Bishkek" , "Asmara" ] print ( "The first city is" , cities[0]) print (cities[2], "is the third city" ) The first city is Shanghai Bishkek is the third city Create a list of five different of foods . Print all list items on one line . Then print each item on a different line . Finally print just the first and fifth items . Example solution: lettuce yoghurt tomato artichoke tuna lettuce yoghurt tomato artichoke tuna The first item is lettuce The fifth item is tuna Lists Task 1 (Five Foods ) Lists Task 2 (Four Numbers ) Create a list of four integer values . Print all list items on one line separated by colons . Example solutions: 345:123:932:758: 812:153:783:603: Add (Append / Insert) to a List Append items to the end of a list To add a new item to the end of a list use the .append() command. Write .append() after the name of your list, with the new data in brackets . pets = [ "dog" , "cat" , "hamster" ] pets.append( "rabbit" ) print (*pets) fillings = [ "ham" , "cheese" , "onion" ] extra = input ( "Enter another filling: " ) fillings.append(extra) print ( "Your sandwich:" , *fillings) dog cat hamster rabbit Enter another filling: lettuce Your sandwich: ham cheese onion lettuce Insert items to a specific index Use the insert command to place an item in a specific position within the list. Remember that Python counts from 0 so the medals example below puts "silver" as index 2 , which is actually the 3rd item . medals = [ "platinum" , "gold" , "bronze" ] medals.insert(2, "silver" ) print (*medals) names = [ "Stacy" , "Charli" , "Jasper" , "Tom" ] name = input ( "Enter a name: " ) position = int ( input ( "Enter an index: " )) names.insert(position,name) print (*names) platinum gold silver bronze Enter a name: Lena Enter an index: 0 Lena Stacy Charli Jasper Tom Enter a name: Pat Enter an index: 3 Stacy Charli Jasper Pat Tom Use a loop to add items to a list A for loop can be used to add a certain number of items to a list. A while loop can be used to keep adding values until a certain value (e.g. ' stop ' or ' end ') is input. animals = [ ] for i in range (4): animal = input ( "Enter an animal: " ) animals.append(animal) print ( "\nAnimals:" , *animals) animals = [ ] while True : animal = input ( "Enter an animal: " ) if animal == "stop" : break else : animals.append(animal) print ( "\nAnimals:" , *animals) Enter an animal: lion Enter an animal: horse Enter an animal: hyena Enter an animal: squirrel Animals: lion horse hyena squirrel Enter an animal: rhino Enter an animal: gazelle Enter an animal: deer Enter an animal: stop Animals: rhino gazelle deer Example solution: Lists Task 3 (Favourite Musicicans ) Create a list of three musicians or bands you like . Print the list . Then append two new bands using two inputs . Print the list again. Use the sandwich filling example for help. Musicians I like: Lana Del Rey Devon Cole Elly Duhé Enter another musician: Charli XCX Enter another musician: Kenya Grace Musicians I like: Lana Del Rey Devon Cole Elly Duhé Charli XCX Kenya Grace Lists Task 4 (Missing 7 ) Create a list of numbers in order from 1 to 10 but miss out 7 . Use the insert command to add 7 in the correct place . Print the list before and after you insert 7. Example solution: 1 2 3 4 5 6 8 9 10 1 2 3 4 5 6 7 8 9 10 Lists Task 5 ('Land' Countries ) Use a while True loop to input countries that end in 'land' until the word 'finish ' is input . Print the list at the end. Note: You do not need to check if the countries entered are correct. There are also more than four. Example solution: Enter a country ending in 'land': Iceland Enter a country ending in 'land': Poland Enter a country ending in 'land': Switzerland Enter a country ending in 'land': Thailand Enter a country ending in 'land': finish Country list: Iceland Poland Switzerland Thailand Delete (Remove/Pop) from a List Delete items with a specific value To delete data with a certain value use the .remove() command, with the value in brackets . trees = [ "fir" , "elm" , "oak" , "yew" ] trees.remove( "elm" ) print (*trees) fir oak yew trees = [ "fir" , "elm" , "oak" , "yew" ] tree = input ( "Select a tree to remove: " ) trees.remove(tree) print (*trees) Select a tree to remove: oak fir elm yew Delete items with a specific index To delete data in a specific position in your list use the .pop() command, with the position in the brackets . Remember that indexes start at 0 so .pop(0) removes the first item . Negative values start from the end of the list , so -1 is the final item and -2 is the second last item and so on. kitchen = [ "plate" , "cup" , "spoon" , "jug" ] kitchen.pop(0) print (*kitchen) kitchen = [ "plate" , "cup" , "spoon" , "jug" ] kitchen.pop(-2) print (*kitchen) kitchen = [ "plate" , "cup" , "spoon" , "jug" ] index = int ( input ( "Select an index: " )) kitchen.pop(index) print (*kitchen) cup spoon jug plate cup jug Select an index: 1 plate spoon jug Delete all items in a list To delete data in a list use the .clear() command. insects = [ "ant" , "bee" , "wasp" ] insects.clear() insects.append( "hornet" ) print (*insects) hornet Lists Task 6 (Day Off ) Example solution: Create a list with the five week days . Ask the user to input a weekday and remove that day from the list. Print the list. Which day do you want off? Tuesday Your new days of work: Monday Wednesday Thursday Friday Lists Task 7 (May and October ) Create a list with the twelve months in order . Delete May and then October using the pop command by referring to their indexes in the list. Print the list. Note: Be aware the index of each month after May will change when May is popped from the list. Example solution: January February March April June July August September November December Finding the Length of a List To find the length of a list use the len function. You can create a separate variable for the length (shown in the first example below) or use the len command directly (second example). states = [ "Maine" , "Utah" , "Ohio" , "Iowa" ] length = len (states) print ( "There are" , length , "states in the list." ) states = [ "Maine" , "Utah" , "Ohio" , "Iowa" ] print ( "There are" , len (states), "states in the list." ) There are 4 states in the list. Lists Task 8 (Q Words ) Use a while True loop to input words beginning with q until the word ' stop ' is entered. Then use len to find the length of the list and print this value. Note: You do not need to check if the entered words actually start with q. Example solution: Input a Q word: question Input a Q word: quick Input a Q word: quiet Input a Q word: quandry Input a Q word: stop You wrote 4 Q words! Cycle Through List Items A for loop can be used to cycle through each item in a list. The following examples present some ways that this may be used. This program uses a for loop to add a word (David) before each list item. davids = [ "Beckham" , "Attenborough" , "Schwimmer" , "Tennant" , "Lynch" ] for i in range (5): print ( "David" , davids[i]) David Beckham David Attenborough David Schwimmer David Tennant David Lynch An if statement can be used within a for loop to check the value of each item . The example below checks how many items are 'medium'. sizes = [ "small" , "medium" , "small" , "large" , "medium" , "small" ] count = 0 for i in range (6): if sizes[i] == "medium" : count = count + 1 print ( "There were" ,count, "medium choices." ) There were 2 medium choices. The program below uses a while loop to allow entries until 'stop ' is input then a for loop to check the value of each item . Because the final length of the list is not known when the program starts, the len command is used in the range of the for loop . sports = [] fcount = 0 rcount = 0 while True : option = input ( "Choose football or rugby: " ) sports.append(option) if option == "stop" : break for i in range ( len (sports)): if sports[i] == "football" : fcount = fcount + 1 elif sports[i] == "rugby" : rcount = rcount + 1 print ( "\nResults:" ,fcount, "people chose football and" ,rcount, "chose rugby." ) Choose football or rugby: rugby Choose football or rugby: rugby Choose football or rugby: football Choose football or rugby: rugby Choose football or rugby: football Choose football or rugby: stop Results: 2 people chose football and 3 chose rugby. Lists Task 9 (Over 25 ) Create a list with the following eight numbers: 13, 90, 23, 43, 55, 21, 78, 33 Use a for loop to cycle through the list and check if each item is over 25 . Use a count variable to increase by 1 if the number is over 25. At the end print how many numbers are over 25 - there are five . Example solution: 5 numbers are over 25. Lists Task 10 (Favourite Lesson ) Use a while True loop to keep inputting school subjects until ' done ' is entered. Keep a count of how many times ' Maths ' is entered. Print the total number of people who entered maths. Example solution: Enter a subject: English Enter a subject: Maths Enter a subject: Art Enter a subject: Maths Enter a subject: History Enter a subject: done There were 2 people who chose maths. Sorting Lists The .sort() command will sort elements in a list into alphabetical order (if a string ) or numerical order (if a number ). names = [ "Robb" , "Jon" , "Sansa" , "Arya" , "Bran" , "Rickon" ] print ( "Original:" , *names) names.sort() print ( "Sorted:" , *names) Original: Robb Jon Sansa Arya Bran Rickon Sorted: Arya Bran Jon Rickon Robb Sansa numbers = [56,98,23,12,45] numbers.sort() print (*numbers) 12 23 45 56 98 The .sort() command can be used to sort values in descending order by including reverse = True in the brackets. names = [ "Robb" , "Jon" , "Sansa" , "Arya" , "Bran" , "Rickon" ] print ( "Original:" , *names) names.sort(reverse = True ) print ( "Sorted:" , *names) Original: Robb Jon Sansa Arya Bran Rickon Sorted: Sansa Robb Rickon Jon Bran Arya numbers = [56,98,23,12,45] numbers.sort(reverse = True ) print (*numbers) 98 56 45 23 12 Lists Task 11 (Sorted Fruit ) Example solution: Use a for loop to append six fruits to an empty list. Sort the list into alphabetical order and print it. Enter a fruit: strawberry Enter a fruit: kiwi Enter a fruit: lemon Enter a fruit: pear Enter a fruit: orange Enter a fruit: mango Sorted fruit: kiwi lemon mango orange pear strawberry Searching Through Lists A simple if statement can be used to see if a certain value appears within a list. names = [ "Alex" , "Bill" , "Charlie" , "Darla" ] name = input ( "Enter a name: " ) if name in names: print ( "Yes," , name , "is in the list." ) else : print ( "Sorry," , name , "is not in the list." ) Enter a name: Bill Yes, Bill is in the list. Enter a name: Sadie Sorry, Sadie is not in the list. Lists Task 12 (Packed Suitcase ) Example solutions: Create a list with five items to take on holiday. Ask the user to input an item and use an if statement to check if it is or isn't in the list. What should I pack? sun cream I've already packed sun cream What should I pack? toothpaste Whoops! I forgot to pack toothpaste Calculating the Sum of a List To calculate the sum of a list of numbers there are two methods. Using Python's built-in sum function : numbers = [1,4,2,3,4,5] print ( sum (numbers)) Both methods will result in the same output : 19 Using a for loop to cycle through each number in the list and add it to a total . numbers = [1,4,2,3,4,5] total = 0 for number in numbers: total = total + number print (total) Lists Task 13 (Sum and Average ) Example solution: Use a for loop to ask the user to input 5 numbers and append each to a list. Use the sum command to output the total and use it calculate the average . Enter a number: 6 Enter a number : 7 Enter a number : 6 Enter a number : 9 Enter a number : 4 The total is 32 The average is 6.4 Extending a List .extend() can be used in a similar way to .append() that adds iterable items to the end of a list . This commands works well with the choice command (imported from the random library ) to create a list of characters that can be randomly selected. The code below adds a lowercase alphabet to an empty list and then, depending on the choice of the user, adds an uppercase alphabet too. The choice command is used in a loop to randomly select 5 characters. Using .extend() to make a random 5-character code from random import choice list = [] list. extend ( "abcdefghijklmnopqrstuvwxyz" ) upper = input ( "Include uppercase letters? " ) if upper == "yes" : list. extend ( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) code = "" for number in range (5): letter = choice (list) code = code + letter print ( "Your five character code is" , code) Possible outputs: Include uppercase letters? yes Your five character code is yPfRe Include uppercase letters? yes Your five character code is GJuQw = Include uppercase letters? no Your five character code is gberv Extend treats each character as an indidual item whereas append adds the whole string as a single entity . Most of time append would be used, but extend is suitable for a password program as additional individual characters can be added to a list depending on the parameters (e.g. lowercase letters, uppercase letters, numbers and special characters). list = [] list. extend ( "ABCD" ) list. extend ("EFGH" ) print (list) list = [] list. append ( "ABCD" ) list. append ("EFGH" ) print (list) ['A','B','C','D','E','F','G','H'] ['ABCD' , 'EFGH'] = = Practice Task 14 Use the code above (for a 5-character code ) to help you make a password generator . Ask the user if they want uppercase letters , numbers and special characters and use the extend command to add them to a list of characters if they type yes (you should extend lowercase characters into an empty list regardless, like in the code above). Use a for loop and the choice command (imported from the random library) to randomly generate a 10-character password . Example solutions: Include uppercase letters? yes Include numbers? yes Include special characters? yes Your new password is RjWSbT&gW5 Include uppercase letters? no Include numbers? yes Include special characters? no Your new password is hdf8se9y2w ⬅ Section 7 Practice Tasks 8b - 2D Lists ➡
- 1.1 - The CPU - Eduqas GCSE (2020 spec) | CSNewbs
Learn about the Central Processing Unit (CPU), the four components within and Von Neumann architecture. Based on the 2020 Eduqas GCSE (WJEC) specification. Exam Board: Eduqas / WJEC 1.1 The Central Processing Unit (CPU) Specification: 2020 + The Central Processing Unit ( CPU ) is the most important component in any computer system. The purpose of the CPU is to process data and instructions by constantly repeating the fetch - decode - execute cycle . CPU Components The control unit directs the flow of data and information into the CPU. It also controls the other parts of the CPU . ALU stands for ‘ Arithmetic and Logic Unit ’. It performs simple calculations and logical operations . The registers are temporary storage spaces for data and instructions inside the CPU. The registers are used during the FDE cycle . Five essential registers are explained in 1.2 . Cache memory is used to temporarily store data that is frequently accessed . Cache memory is split into different levels . Level 1 and level 2 (L1 & L2) are usually within the CPU and level 3 (L3) is just outside it. See 1.3 and 1.5 for more information about cache. You should know: The control unit is also known as the controller and cache memory is sometimes called internal memory . Computer Architecture The way a computer is designed and laid out is known as its architecture . The most common type of computer architecture is Von Neumann . Von Neumann Architecture The CPU is the most important component in Von Neumann architecture as it is constantly fetching and decoding instructions from RAM and controlling the other parts of the system . Von Neumann architecture also stores both instructions and data in memory . Being able to store programs in memory allows computers to be re-programmed for other tasks - this enables it to multitask and run several applications at the same time. Data input and output is another key feature of this architecture. An alternative architecture is Harvard , which features the control unit as the most essential component. Q uesto's Q uestions 1.1 - The Central Processing Unit (CPU): 1a. What does 'CPU ' stand for ? [1 ] 1b. What is the purpose of the CPU ? [ 2 ] 2a. Draw a diagram of the CPU , use the same symbols as shown on this page. [ 4 ] 2b. Label the four main components of the CPU. [ 4 ] 3. Describe the purpose of: a. The Control Unit [ 2 ] b. The ALU [ 2 ] c. The registers [ 2 ] d. Cache memory [ 2 ] 4a. Describe the key features of Von Neumann architecture . [ 3 ] 4b. Explain why storing data in memory is important. [ 1 ] 4c . State an alternative architecture . [ 1 ] Theory Topics 1.2 - The FDE Cycle
- Python | 10c - Remove & Edit Lines | CSNewbs
Learn how to split, edit and removes lines using files in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. Python 10c - REMOVE & Edit LINES Splitting a File The split command is used to split up a line of a file into different parts . The character or string in brackets after the split command is the value that will denote each split . In the example below I have split the file at each comma . Remember that Python numbering starts at 0 so the first section is 0, not 1. 0 1 2 3 The program below splits each line of the file at each forward-slash ( / ). The printed statement is the employee's first name, surname and job position. 0 1 2 3 4 Practice Task 1 Create a file (new txt document in Notepad) called movies. Type in the movie name, main actor, genre (e.g. horror), year it was released and your rating out of 10. Print just the movie name and year it released. Example solution: Deleting Lines in a File Exact Line Name The code below shows how to remove a line from a file using the exact name of the line , which will only work for short or simple files . First open the file in read move to save each line in a variable I've named lines. Then ask the user to input the exact line they want to remove (e.g. 'plum' in my example). Then open the file in write mode and use a for loop to read each line and only write it back into the file if it isn't equal to the line the user entered - such as 'plum'. The line.rstrip() command is important as it removes any spaces or empty lines that may interfere with matching the line to the input. Deleting Lines in a File Word in the Line The code below shows how to remove a line from a file if a certain word appears in that line , although this could be dangerous with large files. In my example I have written apple which has also removed pineapple! The difference from the previous program is to change the for loop so that it checks if the inputted word appears in the line . If it does appear then nothing happens (except a print statement to acknowledge it's been found). If the word doesn't appear then that line can be safely rewritten to the file . Practice Task 2 Download the trees text file. Give the user a choice of removing a specific tree or a type of tree. If they choose a specific tree then remove the line if it is an exact match (e.g. Field Maple). If they choose to remove a type of tree remove all lines that contain the name of that tree (e.g. willow) Make sure you actually check the file to see if the lines have been removed correctly! Example solution: Download the trees file: Sorting a File Sorting a file into alphabetical (or numerical ) order is a simple process. Open the file in read mode and save the lines into a list . The sort c ommand will automatically order the list of lines. If necessary, in the brackets type reverse = True to sort the list in reverse. Practice Task 3 Expand on your tree program from the previous practice task. As well as SPECIFIC or TYPE, allow the user to enter SORT to sort the tree file either in alphabetical order or reverse alphabetical order. Check the text file to see if it has been sorted correctly. You may make this a separate program from task 2 if you wish. Example solution: Editing Lines in a File Overwriting data in a file is a tricky process. The program below uses the same Employees.txt file as above but allows the user to change the address of an employee . A temporary file is created to store the lines of the employee file, but the line with the changes is replaced specifically with the new address. I have explained each line of the program to the right: When I executed the program below I entered Thomas Wynne's details and changed his address. When I opened the employees file the address had been updated : 1: Importing os allows me to rename and remove files later in the program. 3: Opens the employee file in read mode . 5 - 8: Input lines allow the user to enter the first name, surname and the person's new address. 10: A found flag is set up and set to False . 12: The for loop cycles through each line in the file. 13: Each line is split into separate parts from each / . 15: An if statement checks if the first name and surname match an employee in the file. 16: A replacement line is created by putting the original line together but with the new address. 18: The found flag is changed to True because the employee first name and surname matched . 19: A temporary file is created and opened in write mode . 20: The seek command restarts the file at line 0 . 22: The for loop cycles through each line of the employee file from the beginning. If the first name and surname match it will write the new line to the file, otherwise it will rewrite the original line . 28 & 29: Both files are closed . 31 & 32: If the names didn't match , an appropriate message is printed. 34 - 37: If the address was changed, the original file is renamed and deleted and the temp file is renamed as the original file. Practice Task 4 Use the movie file you created for practice task 1. Ask the user to enter the name of a movie. Ask them to enter an updated rating out of 10. Update the file to change the rating to the new value. Example solution: ⬅ 10b - Read & Search Files Section 10 Practice Tasks ➡
- OCR CTech IT | Unit 1 | 4.6 & 4.7 - Bodies & Certification | CSNewbs
Learn about the purpose of professional bodies and IT industry certification. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 4.6 & 4.7 - Bodies & Certification Exam Board: OCR Specification: 2016 - Unit 1 What is a professional body? A professional body is an organisation that seeks to develop and support workers in a certain profession. Professional bodies will share best practice , help people starting in the profession and support any role-related learning . In the UK a popular professional body is the British Computer Society (BCS) - also known as the Chartered Institute for IT - with over 65,000 members. What is industry certification? Professional bodies exist to provide trainees with industry certification . Industry certifications are qualifications in different areas of expertise so applicants are trained with up-to-date knowledge and skills . Two popular organisations that administer industry certifications in America are Cisco and CompTia . Cisco's website claims that they provide "certifications for all experience levels covering topics in networking , security , collaboration , and more. Cisco's certification program can meet you where you are on your learning journey and take you to where you want to go." Advantages of Industry Certification Disadvantages of Industry Certification Develop IT skills: Trainees develop experience and competency in areas relevant to actual jobs. Access resources: Trainees are part of a network of like-minded professionals with access to help from experts . P rofessional development opportunities: Trainees are invited to special events and seminars to ensure skills remain up-to-date . Cost: Training for industry certification can cost hundreds or even thousands of pounds and is often self-funded . No guarantees: Earning a certificate doesn't guarantee you a better job or more money. Time and dedication: Like other qualifications, classroom activities or online learning must be completed. Exams must be passed at the end of the course. Many organisations now require IT employees to have earned relevant industry certifications . This is so that the organisation can be confident that the employee has been appropriately trained and will have gained experience at the required level for the certification. The employee should be able to demonstrate technical knowledge as a result of gaining the certification. Q uesto's Q uestions 4.6 & 4.7 - Bodies & Certification: 1a. What is a professional body ? [1 ] 1b. State 3 roles of a professional body . [3 ] 2. What are industry certifications ? [2 ] 3. Describe 3 advantages and 3 disadvantages of an IT worker earning industry certifications . [2 each ] 4. Why do many IT organisations require its employees to have earned industry certifications ? [4 ] 4.5 - Job Roles Topic List 5.1 - Ethical Issues







