Search CSNewbs
304 results found with an empty search
- Python | Section 9 Practice Tasks | CSNewbs
Test your understanding of string and number handling techniques in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python - Section 9 Practice Tasks Task One It is the national hockey championships and you need to write the program for the TV channel showing the live games. Let the user enter the name of the first country that is playing. Then let the user enter the name of the second country . Shorten country 1 to the first two letters . Shorten country 2 to the first two letters . Bonus: Display the teams in uppercase . Example solution: Welcome to the National Hockey Championships!!! Enter the first country: Montenegro Enter the second country: Kazakhstan Scoreboard: MO vs KA G Task Two In some places, the letter G is seen as an offensive letter. The government want you to create a program to count how many times the letter G appears in a sentence . Let the user input any sentence that they like. You need to count how many g’s there are. Then print the number of g’s there are. Example solution: Enter your sentence: good day! great golly gosh, got a good feeling! There were 7 instances of that awful letter! Task Three A pet shop has just ordered in a batch of new dog collars with name tags. However, there was a mistake with the order and the tags are too small to display names longer than 6 characters . You need to create a program that checks the user’s dog name can fit. Let the user enter their dog’s name . Calculate the length of their name. Use an if statement to see if it is greater than 6 characters . If it is then print – Sorry but our dog tags are too small to fit that. Otherwise print – Excellent, we will make this dog tag for you. Example solutions: Welcome to 'Dogs and Cats' Pet Shop! What is the name of your dog? Miles Excellent, we will make this dog tag for you! Welcome to 'Dogs and Cats' Pet Shop! What is the name of your dog? Sebastian Sorry, our dog tags are too small! Task Four It’s literacy week and the Head of English would like you to create a vowel checker program to ensure that year 7s are using plenty of vowels in their work. Let the user enter any sentence they like. For each letter in the sentence that they have just entered you need to use if statements to check if it is a vowel . You will need to use the OR operator between each statement to separate them. After the for loop you need to print the number of vowels they have used. Example solution: Enter your sentence: Put that thing back where it came from, or so help me! You used 14 vowels in your sentence. Task Five Remember the national hockey championships? Well, the company that hired you just fired you… Never mind though, a rival scoreboard company want to hire you right away. You need to let the user enter two countries like last time. But this time you don’t want to calculate the first two letters, you want to print the last three letters . Example solution: Welcome back to the National Hockey Championships!!! Enter the first country: Montenegro Enter the second country: Kazakhstan Scoreboard: GRO vs TAN Task Six Too many people are using inappropriate names on Instagram so they have decided to scrap the username and will give you a code instead. The code is the 2nd and 3rd letters of your first name , your favourite colour and then the middle two numbers of the year you were born . Let the user input their name, then their favourite colour and then the year they were born. Using their data, calculate their new Instagram name! Example solution: Welcome to Instagram What is your name? Matthew What is your favourite colour? red Which year were you born in? 1987 Your new profile name is: ATRED98 Task Seven Copy the text on the right and create a program that will split the text at each full stop. Count the number of names in the list. Print the longest name. Example solution: The list contains 20 names The longest name is alexandria annabelle.clara.damien.sarah.chloe.jacques.mohammed.steven.rishi.raymond.freya.timothy.claire.steve.alexandria.alice.matthew.harriet.michael.taylor ⬅ 9b - Number Handling 10a - Open & Write To Files ➡
- 2.5 - Compression - OCR GCSE (J277 Spec) | CSNewbs
Learn about the benefits of compression and the differences between lossy and lossless compression. Also, learn how compression ratios work. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 2.5: Compression Exam Board: OCR Specification: J277 Watch on YouTube : Compression Benefits Lossy Compression Lossless Compression What is compression? To compress a file means to make its size smaller . Benefits of compression include: Files take up less storage space (so more files can be stored). Files can be transferred quicker (because they are smaller). Files can be read from or written to quicker . There are two methods that are used to compress files: Lossy and Lossless . Lossy Compression Lossy compression uses an algorithm (set of instructions) to analyse a file and remove data that cannot be heard or seen by humans . For example, a lossy algorithm would analyse the sound waves of an audio file and remove any frequencies which humans cannot hear. This process reduces the size of the file . Further lossy compression will remove data that humans can see / hear . For example, the dog image to the right has been strongly compressed using a lossy algorithm and some data has clearly been removed. Lossy compression removes the data permanently , so the file can never return to its original form . Lossy compression is often used with images , audio and video to reduce the file size, for example to send over the internet. Lossless Compression Lossless compression reduces the size of a file without permanently removing any data . Because of this, the file is returned to its original form when decompressed, so no quality is lost . A file that is compressed with a lossless algorithm is usually larger than a file compressed with a lossy algorithm because no data has been permanently removed. Lossless compression is used with files that would not function properly if data were permanently removed, such as executable files (e.g., programs and games) or word documents . Remember that lossy and lossless compression do not just refer to images. Below is an audio file that has been compressed with lossy compression . Data has been removed so the audio quality has decreased. 197 KB 81 KB 43 KB Q uesto's Q uestions 2.5 - Compression: 1. Describe 3 benefits of compressing a file . [ 3 ] 2. Describe the differences between lossy and lossless compression . [4 ] 3. A student needs to compress a Microsoft Word document to send in an email. Suggest which type of compression they should use and why . [ 2 ] 2.4e Sound Storage Theory Topics 3.1a - Network Types & Performance
- Python | 1a - Printing | CSNewbs
Learn how to create print statements in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 1a - Printing Printing in Python To output a message onto the screen, use the print command. Then place your message within brackets and speech marks . For example: print ( "Welcome to Python!" ) When you run the program, the text will print to the Python console: Welcome to Python! Printing Task 1 (Full Name & To Your Left) On the first line, print your first name and surname. On the next line, write another print statement to print t he name of the person (or thing) to your left. Example solution: Elsie Parker pencil case Printing over Several Lines One way of writing across multiple lines is to write several print commands like this: print ( "Welcome to...." ) print ( "Computer Science " ) print ( "Newbies!!! " ) = Welcome to .... Computer Science Newbies!!! However, when we program, we always want to make our code the most efficient it can be by using as few lines as possible . Therefore you can write \n within a printed statement to move it to the next line. Make sure you use \ and not / otherwise it will print the slash and not make a new line! print ( "Welcome to....\n Computer Science\n Newbies!!! " ) = Welcome to .... Computer Science Newbies!!! Both pieces of code display the same thing, but the second one is more efficient because it only uses one line. Printing Task 2 (Name, Colour, Movie) Use \n to write your name, favourite colour and favourite movie in only one line of code. Example solution: Matthew yellow Interstellar ⬅ Setting Up Python 1b - Comments ➡
- Python | 6b - While Loops | CSNewbs
Learn how to create and use while loops in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 6B - While Loops Types of Loop The third construct of programming (after Sequence and Selection) is Iteration . If you iterate something, then you repeat it. There are two key loops to use in Python: for loops and while loops . A for loop is count controlled – e.g. “For 10 seconds I will jump up and down”. The loop will continue until the count (e.g. 10 seconds) has finished . A while loop is condition controlled – e.g. “While I am not out of breath, I will jump up and down.” The loop will continue as long as the condition remains true . Simple While Loops A while loop keeps repeating as long as the starting condition is true . If the condition of the while loop becomes false , the loop ends . In this example, the number variable is increased by 1 inside of the loop until it is no longer less than or equal to 10 . number = 1 while number <= 10: print (number) number = number + 1 1 2 3 4 5 6 7 8 9 10 Comparison Operators == equal to != not equal to < less than <= less than or equal to > greater than >= greater than or equal to It is important to give the variable a value before you start the while loop . I have assigned number as 1. The last line increases the number by 1 otherwise the number would stay at 1 and the loop would repeat forever . While Loops Task 1 (Countdown from 100 ) Example solution (shortened): Create a simple while loop that starts at 100 and prints each number down to 1 . Think about the comparison operator you will need to check you have reached 1. 100 99 98 ... ... 3 2 1 Inputs Inside While Loops If you want the user to keep entering an input until they give a certain answer then you need to put the input inside the while loop : age = 0 while age < 18: print ( "Only adults allowed to the casino." ) age = int ( input ( "Enter your age: " )) print ( "Welcome and enjoy your visit." ) Only adults allowed to the casino. Enter your age: 14 Only adults allowed to the casino. Enter your age: 18 Welcome and enjoy your visit. month = " " while month != "July" : month = input ( "Guess the month I'm thinking of: " ) print ( "Correct! It was July!" ) Guess the month I'm thinking of: August Guess the month I'm thinking of: June Guess the month I'm thinking of: July Correct! It was July! Notice that the variable in the condition (age or month in these examples) has to be given a value first before it can be used in a while condition. The program will crash if the variable is not declared and assigned a value - for example, the age cannot be checked to see if it less than 18 if there is no age variable! For string variables like month in the example above then a blank default value like " " can be used. For integer variables often 0 will be used. While Loops Task 2 (Guess the Colour ) Example solution: Use a variable named colour and a while loop that allows the user to keep entering colours until a specific one (your choice) has been input. Guess the colour: blue Guess the colour: purple Guess the colour: yellow Correct! It was yellow! While Loops Task 3 (Integer Trivia ) Use a while loop to ask a question that has an integer (whole number) as an answer , such as "How many James Bond films did Daniel Craig appear in?" or "In which year did Wigan Athletic win the FA Cup?". Remember that integers do not use speech marks , e.g. year = 0 Example solution: Which year was the first Iron Man movie? 2010 Which year was the first Iron Man movie? 2009 Which year was the first Iron Man movie? 2008 Correct! It was 2008! While True Loops A while True loop will repeat indefinitely , only stopping when the break command is used to end the loop . While True loops are often preferred because you do not need to set default values for any variables before the loop begins. while True : password = input ( "Enter the password: " ) if password == "icecream21" : print ( "Correct Password!" ) break Enter the password: vanilla32 Enter the password: chocolate83 Enter the password: strawberry100 Enter the password: icecream21 Correct Password! The program below has been adapted to record the number of attempts made . The value is increased by 1 each time the loop restarts. guesses = 0 while True : guesses = guesses + 1 password = input ( "Enter the password: " ) if password == "goat7" : print ( "Correct Password! It took" ,guesses, "attempts!" ) break else : print ( "Incorrect. Try again!" ) Enter the password: sheep3 Incorrect. Try again! Enter the password: cow4 Incorrect. Try again! Enter the password: horse5 Incorrect. Try again! Enter the password: goat7 Correct Password! It took 4 attempts! The continue command will move to the next iteration (it can be considered as starting the loop again ). The program below allows numbers to be entered and keeps track of a running total. Entering 1 inputs a number, 2 displays the total and 3 stops the program. total = 0 while True : choice = input ( "\nType 1 to enter, 2 for a total and 3 to stop: " ) if choice == "1" : number = int ( input ( "Enter a number: " )) total = total + number continue elif choice == "2" : print ( "The total is" , total) continue elif choice == "3" : break print ( "\nProgram finished." ) Type 1 to enter, 2 for the total and 3 to stop: 1 Enter a number: 40 Type 1 to enter, 2 for the total and 3 to stop: 1 Enter a number: 35 Type 1 to enter, 2 for the total and 3 to stop: 2 The total is 75 Type 1 to enter, 2 for the total and 3 to stop: 3 Program finished. While Loops Task 4 (Guess the Planet ) Example solution: Use a while True loop to keep asking a user to input a planet . Keep track of the number of guesses that have been made and output the total when they input the correct planet. Use the second example in the 'While True Loops ' section above to help you. Enter a planet: Mars Incorrect guess, try again! Enter a planet: Mercury Incorrect guess, try again! Enter a planet: Neptune Correct it was Neptune! While Loops Task 5 (Up to 100 ) Create a while True loop that asks the user to enter a number . Add the number to a total variable and print it. When the total reaches 100 or more , stop the program. Don't forget to set the total variable to 0 at the start and to add the number entered by the user to the total. Example solution: Enter a number: 34 The current total is: 34 Enter a number: 29 The current total is: 63 Enter a number: 18 The current total is: 81 Enter a number: 22 The current total is: 103 Over 100! ⬅ 6a - F or Loops Section 6 Practice Tasks ➡
- 10.3 - Programming Errors - Eduqas (2020 Spec) | CSNewbs
Learn about the six programming errors - syntax, runtime (execution), linking, logical, rounding and truncation. Based on the 2020 Eduqas (WJEC) GCSE specification. 10.3: Programming Errors Exam Board: Eduqas / WJEC Specification: 2020 + Syntax Error A syntax error is a mistake in the grammar or spelling of the program. A syntax error will prevent the program from being compiled . Examples: Incorrect Spelling: pront ( "hello" ) Incorrect punctuation: print ( "hello" ( Execution (Runtime) Error An execution error is when the program unexpectedly stops as a result of an operation during execution . Examples: Dividing by zero: 400 / 0 Reading too far in a file: #There are 50 lines in the file line = file.readlines( ) print ( line [100] ) Logical Error Linking Error A logical error is a mistake made by the programmer - the program still works but displays the wrong output . Examples: Truncation Error Rounding Error A linking error occurs when a compiler can’t find a sub procedure (e.g. the random library in Python) that has been used. The programmer might have declared it incorrectly or forgotten to link (import) it . Examples: Spelling an import command incorrectly: import ramdon number = random.randint(1,10) Requesting a function without linking: number = random.randint(1,10) Incorrect calculation: total = num1 - num2 print (total) Incorrect variable printed: age = 16 name = "Steve" print ( "Nice to meet you" , age) A rounding error is when the program rounds a real number to a fixed number of decimal places. This results in losing some value as the number becomes less accurate . Examples: Rounding up: 80.87 = 80.9 (Inaccurate by 0.03) Rounding down: 63.4 = 63 (Inaccurate by 0.4) A truncation error is when the program truncates a real number to a fixed number of decimal places . This results in losing some value as the number becomes less accurate . Examples: Truncation to 2 decimal places: 92.13787 = 92.13 (Inaccurate by 0.00787) Truncation to 1 decimal place: 25.199876 = 25.1 (Inaccurate by 0.099876) Q uesto's Q uestions 10.3 - Programming Errors: 1. Describe and give an example of each type of error: a. Syntax Error [ 3 ] b. Execution (Runtime) Error [ 3 ] c. Logical Error [ 3 ] d. Linking Error [ 3 ] e. Rounding Error [ 3 ] f. Truncation Error [ 3 ] 2. State the error that will occur for each scenario: [1 each ] a. A command word (such as for or print) has been misspelt. b. The average speed is 120.3856 but only 120.3 is displayed. c. The cost of a meal is £47 but £40 is displayed. d. A program uses a subroutine that has not been imported. e. The height of a dog is 33.38cm but 33.4cm is displayed. f. The user wants to read line 9 of a file that only has 6 lines. g. The user's age is printed instead of their name. h. The programmer has typed print("hello"( i. A number is divided by 0. j. The program is asked to generate a random number but 'import random' has not be written. 10.2 - Stages of Compilation Theory Topics 11.1 - Impacts of Technology
- OCR CTech IT | Unit 1 | 1.7 - Units of Measurement | CSNewbs
Learn about the two types of data storage unit systems and how the increments work, including kilobyte and kibibyte. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 1.7 - Units of Measurement Exam Board: OCR Specification: 2016 - Unit 1 All computer systems communicate , process and store data using binary because this is the format that the processor understands . Binary is a number system consisting entirely of 0s and 1s . A single binary data value (a 0 or a 1 ) is called a bit . 4 bits is called a nibble (e.g. 0101 or 1100). 8 bits is called a byte (e.g. 10101001 or 01011100). There are two main measurement systems : Metric Units of Measurement The gap between units when using metric values (also known as the decimal system ) is always 1,000 . For example, there are 1,000 bytes in 1 kilobyte and 1,000 kilobytes in 1 megabyte . To convert between metric units , divide by 1,000 when moving to a larger unit (e.g. 500 megabytes is 0.5 gigabytes ) and multiply by 1,000 when moving to a smaller unit (e.g. 4.7 terabytes is 4,700 gigabytes ). For example, 8,520 KB is the same as 8.52 MB or 0.00825 GB . Metric values (usually) have a prefix ending in ‘ a ’ such as mega byte or giga byte. Binary Units of Measurement The gap between units when using binary values is always 1,024 . For example, there are 1,024 bytes in 1 kibibyte and 1,024 kibibytes in 1 mebibyte . To convert between binary units , divide by 1,024 when moving to a larger unit (e.g. 4,096 kibibytes is 4 mebibytes ) and multiply by 1,024 when moving to a smaller unit (e.g. 55 pebibytes is 55,296 tebibytes ). For example, 34 KiB is the same as 34,816 MiB or 35,651,584 GiB . Bi nary values have a prefix ending in ‘ bi ’ , such as ki bi byte or me bi byte. Computer scientists often use the binary system of measurement because the storage size is technically more accurate . Q uesto's Q uestions 1.7 - Units of Measurement: 1 a. Create a table or list that clearly shows the relationship between values from bit up to petabyte for the metric (decimal) measurement system . [4 ] 1 b. Create another table to display the binary measurement system from bit to pebibyte . [4 ] 2. Make the following conversions and show your working out . [2 each ] a. 40 megabytes into kilobytes . b. 8500 gigabytes into terabytes . c. 100 mebibytes into kibibytes . d. 854,016 mebibytes into gibibytes . e. How many bytes are there in 3 megabytes ? f. How many bytes are there in 3 mebibytes ? 1.6 - Hardware Troubleshooting 1.8 & 1.9 - Number Systems Topic List
- OCR CTech IT | Unit 1 | 2.4 - Operating Systems | CSNewbs
Learn about different types of operating systems and the various roles that they manage, including memory, security and processing. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 2.4: Operating Systems Exam Board: OCR Specification: 2016 - Unit 1 An operating system (OS) is software that manages the resources of a computer system . The operating system is loaded by the BIOS (Basic Input / Output System). Types of Operating System Single user operating systems are found on most desktop computers, laptops and tablets where only one person will use the device at a single time. Multi-user operating systems allow more than one user to access the processor simultaneously , such as a server that users, with correct permissions , can access remotely . However, one user should not be negatively impacted by another user on the same operating system and security must be managed carefully as data may be visible to other users . Single Processor operating systems have only a single processor (CPU), which is shared between users by dividing the CPU time into time-slices and allocating one of these to each user in turn. The time-slices are very short, giving each user the impression that their programs are running continuously. Multiple Processor operating systems have more than one processor (CPU). Users still have to share processors and it is a more complicated system but performance is improved as there are fewer users per processor. Some supercomputers have thousands of processors running in parallel. Operating systems can also be off-the-shelf , open-source or bespoke . See 2.1 . What are the roles of an Operating System? Manage Input / Output Devices Receives data from input devices (e.g. a keyboard). Sends data to output devices (e.g. a monitor) in the correct format . Manage Printing Checks the printer is free then uses spooling (storing data in a queue ) to print documents in order. Manage Backing (Secondary) Storage Ensures data is stored correctly and can be retrieved from secondary storage devices (e.g. hard drive / SSD ). Organises files in a hierarchical structure. Manage Memory (RAM) Ensures that programs / data do not corrupt each other and are stored in correct memory locations . Manage Processes Ensures different processes can utilise the CPU and do not interfere with each other or crash. On most OS the tasks appear to run simultaneously . Manage Security Allows users to create, manage and delete user accounts with different permissions. Allows users to logon and change passwords . User Interface The final function of an operating system is to provide a user interface . This includes: A folder and file system is displayed and manipulated allowing for copying , searching , sorting and deleting data. Icons are displayed to represent shortcuts to applications and files. Multiple windows can be opened at the same time and switched between. The interface can be customised , such as changing font sizes and the desktop background . System settings can be accessed such as network and hardware options . Q uesto's Q uestions 2.4 - Operating Systems: 1. Describe five different roles of the operating system. Include the importance of the operating system in performing each role. [ 5 ] 2. What is the difference between single user and multi-user operating systems? [2 ] 3. What is the difference between single processing and multi-processing operating systems? [2 ] 4. Using your knowledge from 2.1 Software Types, explain two advantages and one disadvantage to a company if they decided to use a closed source operating system. [6 ] 2.3 Utility Software Topic List 2.5 Communication Methods
- 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
- 1.1 - Computational Thinking - OCR GCSE (J277 Spec) | CSNewbs
Learn about the three elements of computational thinking - abstraction, decomposition and algorithmic thinking. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 1.1: Computational Thinking Exam Board: OCR Specification: J277 There are three key components to computational thinking (smart problem solving): Abstraction is when you ignore unnecessary information and focus only on the important facts . Abstraction is used because it simplifies a problem to make it less complex . This makes it more straightforward to understand the problem and create a solution . Decomposition is when you break a problem down into smaller tasks so that it is easier to solve . Each individual problem can be separately tested and solved . Decomposition also enables different people to work on the different parts of a larger problem that can later be recombined to produce a full solution . Algorithmic thinking is the final stage as logical steps are followed to solve the problem . The problem is broken down using decomposition into smaller problems . The required data and relevant data structures are considered using abstraction . Watch on YouTube : Abstraction Decomposition Algorithmic Thinking Q uesto's Q uestions 1.1 - Computational Thinking: 1. What does the term 'abstraction ' mean? Why is it important ? [2 ] 2. What is meant by ' decomposition '? Why is it important ? [ 2 ] 3. What is algorithmic thinking ? What does it involve? [3 ] Theory Topics 1.2 - Designing Algorithms
- 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 | 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 ➡
- 2.2 - Secondary Storage - OCR GCSE (J277 Spec) | CSNewbs
Learn about the three main types of secondary storage - magnetic, optical and solid-state. Also, learn about the characteristics of secondary storage media including reliability and durability. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 2.2: Secondary Storage Exam Board: OCR Specification: J277 Watch on YouTube : Secondary Storage Six Characteristics Magnetic Storage Optical Storage Solid State Storage Secondary storage is non-volatile storage used to save and store data that can be accessed repeatedly. Secondary storage is not directly embedded on the motherboard (and possibly even external ) and therefore further away from the CPU so it is slower to access then primary storage . Storage Characteristics you should know: CAPACITY : The maximum amount of data that can be stored on the device. DURABILITY : The strength of the device, to last without breaking . PORTABILITY : How easy it is to carry the device around . ACCESS SPEED : How quickly data on the device can be read or edited . COST : The average price it costs to purchase the storage device. RELIABILITY : The likelihood of the device continuing to perform well over time . Magnetic Storage A magnetic hard disk drive (HDD ) is the most common form of secondary storage within desktop computers. A read/write head moves nanometres above the disk platter and uses the magnetic field of the platter to read or edit data. An obsolete (no longer used) type of magnetic storage is a floppy disk but these have been replaced by solid state devices such as USB sticks which are much faster and have a much higher capacity. Another type of magnetic storage that is still used is magnetic tape . Magnetic tape has a high storage capacity but data has to be accessed in order (serial access ) so it is generally only used by companies to back up or archive large amounts of data . Magnetic Storage Characteristics (Hard Disk Drive): ✓ - Large CAPACITY and cheaper COST per gigabyte than solid state . ✓ - Modern external HDDs are small and well protected so they are DURABLE and PORTABLE , however because of the moving parts, they should not be moved when powered on because it can damage the device. X - Slower ACCESS SPEED than solid state but faster than optical storage . Optical Storage Optical storage uses a laser to project beams of light onto a spinning disc, allowing it to read data from a CD , DVD or Blu-Ray . This makes optical storage the slowest of the four types of secondary storage. Disc drives are traditionally internal but external disc drives can be bought for devices like laptops. Magnetic Disks are spelled with a k and Optical Discs have a c. Optical Storage Characteristics: X - Low CAPACITY : 700 MB (CD ), 4.7 GB (DVD ), 25 GB (Blu-ray ). X - Not DURABLE because discs are very fragile and can break or scratch easily. ✓ - Discs are thin and very PORTABLE . Also very cheap to buy in bulk. X - Optical discs have the Slowest ACCESS SPEED . Solid State Storage There are no moving parts in solid state storage. SSD s (Solid State Drives ) are replacing magnetic HDDs (Hard DIsk Drives) in modern computers and video game consoles because they are generally quieter , faster and use less power . A USB flash drive ( USB stick ) is another type of solid state storage that is used to transport files easily because of its small size. Memory cards , like the SD card in a digital camera or a Micro SD card in a smartphone , are another example of solid state storage. Solid State Characteristics: X - More expensive COST per gigabyte than magnetic . ✓ - Usually DURABLE but cheap USB sticks can snap or break . ✓ - The small size of USB sticks and memory cards mean they are very PORTABLE and can fit easily in a bag or pocket. ✓ - Solid State storage have a high CAPACITY and the fastest ACCESS SPEED because they contain no moving parts . Q uesto's Q uestions 2.2 - Secondary Storage: 1. Rank magnetic , optical and solid-state storage in terms of capacity , durability , portability , speed and cost . For example, magnetic has the highest capacity , then solid-state, then optical. This could be completed in a table . [15 ] 2. Justify which secondary storage should be used in each scenario and why it is the most appropriate: a. Sending videos and pictures to family in Australia through the post . [ 2 ] b. Storing a presentation to take into school . [ 2 ] c. Storing project files with other members of a group to work on together . [ 2 ] d. Backing up an old computer with thousands of files to a storage device. [ 2 ] 2.1 - Primary Storage Theory Topics 2.3 - Data Units







