top of page

Search CSNewbs

304 results found with an empty search

  • 3.1a - 3.1d - Algorithm Complexity | OCR A-Level | CSNewbs

    Learn about pseudocode, procedural programming, big O notation (constant, linear, polynomial (quadratic), exponential, linearithmic and logartihmic) and the complexity of different data structure, sorting and searching algorithms. Based on the OCR H446 Computer Science A-Level specification. Exam Board: OCR A-Level Specification: Computer Science H446 3.1a - 3.1d - Algorithm Complexity Watch on YouTube : Pseudocode Procedural programming Big O notation Algorithm complexity Pseudocode Pseudocode is a simplified , language-independent way of writing algorithms that looks like programming but uses plain English to describe the steps clearly without worrying about exact syntax . The OCR A-Level Computer Science course uses a form of pseudocode unique to the exam board called 'OCR exam reference language ' that all code in exams will be written in . OCR exam reference language uses closing commands such as endif for an if statement and endwhile for a while loop . It also uses the word then instead of a colon like in Python . YouTube video uploading soon Procedural Language A procedural language , such as Python or Java , is a programming language that structures programs as sequences of step-by-step instructions grouped into procedures or functions . It focuses on breaking tasks into smaller , reusable blocks of code that operate on data , making programs easier to write , understand and maintain . This topic is in both Paper 1 and Paper 2 . YouTube video uploading soon Big O Notation O(n) Big O Notation is a way of describing how the time complexity (how long an algorithm takes ) and space complexity (how much memory it uses ) grows as the size of the input increases . This allows algorithms to be compared in terms of efficiency , using the letter n to refer to the size of the input . Complexity types: Constant - O(1) - The algorithm’s time or space stays the same no matter how large the input is . Linear - O(n) - The time or memory grows directly in proportion to the size of the input . Polynomial - O(n²) - The growth increases in proportion to the square of the input , often seen in algorithms with nested loops . Exponential - O(2ⁿ) - The time or memory doubles with each additional input element , becoming extremely slow very quickly . Logarithmic - O(log n) - The algorithm’s time grows very slowly as the input size increases , often achieved by repeatedly halving the data . Linearithmic - O(n log n) - A combination of linear and logarithmic behaviour, common in efficient sorting algorithms like merge sort . YouTube video uploading soon Algorithm Complexity Best-case , average-case and worst-case complexity describe how an algorithm performs under different input conditions . Best-case complexity is the time or space required when the algorithm meets the most favourable input , allowing it to finish as quickly or efficiently as possible . Average-case complexity represents the expected performance across typical or random inputs , giving a realistic view of how the algorithm behaves in normal use . Worst-case complexity is the maximum time or space the algorithm could ever require , used to guarantee performance even in the least favourable situation . Sorting and searching algorithms often have different case complexities for time and space . YouTube video uploading soon This page is under active development. Check here for the latest progress update. Q uesto's K ey T erms Pseudocode Procedural Language: input, output, comments, variables, casting, count-controlled iteration, condition-controlled iteration, logical operators, selection, string handling, subroutines, arrays, files Big O Notation: time complexity, space complexity, constant, linear, polynomial, exponential, logarithmic, linearithmic, best-case, average-case, worst-case D id Y ou K now? Minecraft doesn’t load the entire world at once ; instead, it divides the world into chunks and only generates or loads the chunks near the player . Finding , saving and retrieving these chunks uses data structures like trees and hash maps , which allow the game to look up a chunk in about O(log n) or even O(1) time , minimising lag even in large worlds . 2.2 - Computational Methods A-Level Topics 3.1e - Data Structure Algorithms

  • 1.1b - Registers & FE Cycle - OCR GCSE (J277 Spec) | CSNewbs

    Learn about key registers used in the fetch - execute cycle such as the program counter and current instruction register. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 1.1b: Registers & The F-E Cycle Exam Board: OCR Specification: J277 Watch on YouTube : Registers in the FE Cycle Reading instructions The fetch - execute (F-E) cycle is performed by the CPU millions of times every second. This cycle is how the CPU processes data and instructions for each program or service requiring attention . Important Registers A register is a small storage space for temporary data in the CPU . Each register has a specific role . There are four essential registers used in the F-E cycle : Program Counter (PC) A register that tracks the RAM address of the next instruction to be fetched . Memory Address Register (MAR) Stores the RAM address of the current instruction (or data ) the CPU needs to access . Memory Data Register (MDR) The MDR stores the instruction that has been transferred from RAM to the CPU . Accumulator (ACC) The ACC stores the result of mathematical or logical calculations . The PC , MAR and MDR are used in the fetch stage , whereas the ACC is used in the execute stage . The PC and MAR store an address (a memory location in RAM ) whereas the MDR and ACC store data (a value ). Fetch - Execute Cycle The essential idea of the F-E cycle is that instructions are fetched from RAM , to be decoded (understood) and executed (processed) by the CPU . 1. The Program Counter (PC ) register displays the address in RAM of the next instruction to be processed . This value is copied into the Memory Address Register (MAR ). 0054 2. The PC register is increased by 1 . This prepares the CPU for the next instruction to be fetched. 0055 3. The CPU checks the address in RAM which matches the address held in the MAR . 0054 4. The instruction in RAM is transferred to the Memory Data Register (MDR ). MDR 5. The instruction is decoded by the contol unit which splits the instruction into an opcode (an action ) and an operand ( data or address ). 6. The instruction i s executed (run). Any result of an execution is stored in the Accumulator (ACC ) register, such as calculations made by the ALU . ACC 7. The cycle repeats by returning to the first step and checking the program counter for the address of the next instruction . Q uesto's Q uestions 1.1b - Registers & The F-E Cycle: 1 . What is the purpose of the registers ? [1 ] 2 . Describe the purpose of each register : a. The Program Counter (PC) [ 2 ] b. The Memory Address Register (MAR) [ 2 ] c. The Memory Data Register (MDR) [ 2 ] d. The Accumulator (ACC) [ 2 ] 3. Draw a diagram with icons and words to show the steps of the Fetch - Execute cycle . [7 ] 1.1a - The CPU Theory Topics 1.2 - CPU Performance

  • OCR GCSE Topic List | CSNewbs

    The list of topics in the 2020 OCR GCSE Computer Science specifications. OCR GCSE Computer Science (J277) These pages are based on the J277 OCR GCSE Computer Science specification . This website is in no way affiliated with OCR . Component One: Computer Systems OCR GCSE Key Term Generator Paper 1 Playlist on YouTube 1. Systems Architecture 1.1a - The CPU 1.1b - Registers & FE Cycle 1.2 - CPU Performance 1.3 - Embedded Systems 2. Memory & Storage 2.1 - Primary Storage 2.2 - Secondary Storage 2.3 - Units 2.4a - Number Systems 2.4b - Binary Addition & Shifts 2.4c - Character Storage 2.4d - Image Storage 2.4e - Sound Storage 2.5 - Compression 3. Networks 3.1a - Network Types & Performance 3.1b - Network Hardware & Internet 3.2a - Wired & Wireless networks 3.2b - Protocols & Layers 4. Network Security 4.1 - Network Threats 4.2 - Preventing Vulnerabilities 5. Systems Software 5.1 - Operating Systems 5.2 - Utility Software 6. Impacts 6.1a - Impacts of Technology 6.1b - Legislation Component Two: Computational Thinking, Algorithms and Programming Paper 2 Playlist on YouTube 1. Algorithms 1.1 - Computational Thinking 1.2 - Designing Algorithms 1.3 - Searching & Sorting Algorithms 2. Programming Fundamentals 2.1 - Programming Fundamentals 2.2 - Data Types 2.3 - Additional Programming Techniques 3. Producing Robust Programs 3.1 - Defensive Design 3.2 - Testing 4. Boolean Logic 4.1 - Boolean Logic 5. Languages & IDEs 5.1 - Languages & Translators 5.2 - Integrated Development Environment

  • 7.1 - Language Levels - Eduqas GCSE (2020 Spec) | CSNewbs

    Learn about the two types of language levels, high level and low level, including explanations and examples. Based on the 2020 Eduqas (WJEC) GCSE specification. 7.1: Language Levels Exam Board: Eduqas / WJEC Specification: 2020 + There are two types of programming languages used within computer systems: High-Level Languages Why do programmers use high-level languages? H igh-level programming languages use code written in a way that is similar to a natural human language , such as English, making it easier to understand and use the language. Using high-level languages leads to fewer errors and allows for more powerful and complex commands compared to low-level languages. However, a high-level language must be translated into machine code (binary) before it can be run, as high-level languages cannot be executed directly by the CPU . Popular high-level languages: PYT HON C++ Ja v a Visual Basic Low-Level Languages Low-level languages do not closely resemble a natural human language , making it harder for humans to understand and write in. Low-level languages are used when a program must be executed quickly or when programmers need to write code that interacts directly with the hardware , such as device drivers. There are two types of low-level language : Machine Code This is the pure binary code that computers can directly process and execute . It is extremely tedious and difficult for humans to understand and write machine code. However, machine code can be used when a programmer needs to perform a very specific command that can't be done in a high-level language. Machine code will be executed faster than high-level programs because it is already in a format the CPU can execute and does not need to be translated . 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 0101 0100 1010 1010 1010 1010 1111 1110 0010 1001 0100 1001 0010 0111 0111 0101 0011 1010 1000 0101 0110 0111 0000 1010 1010 0011 1101 1001 0010 1101 0010 0100 1001 0011 1010 1001 0101 0101 0010 0101 0111 0101 0101 1000 1011 0111 Assembly Language Assembly language uses specialised command mnemonics to perform actions . See the Assembly Language section in the programming tab for a list of mnemonics such as INP , OUT and HLT . Assembly language is preferred by many programmers over machine code because it is easier to understand and spot errors . It is faster to execute than high-level languages and, like machine code, can be used to directly control the CPU . Q uesto's Q uestions 7.1 - Language Levels: 1a. Describe three reasons why programmers use high-level languages . [ 3 ] 1b. Explain one limitation of using high-level languages . [2 ] 2a. Describe a key difference between low-level languages and high-level languages . [ 2 ] 2b. Describe when a low-level language would be used instead of a high-level language . [2 ] 2c. Describe an advantage and a disadvantage of writing directly in machine code . [2 ] 2d. Describe what assembly language is. Give one benefit to using assembly language instead of machine code and one benefit to using it instead of a high-level language . [3 ] 3. Compare high-level and low-level languages by stating which is: a. Easier to understand [ 1 ] b. Requiring translation [ 1 ] c. Quicker to execute [ 1 ] INP STA Number1 OUT HLT Number1 DAT 6.2 - Utility Software Theory Topics 8.1 - Programming Principles

  • OCR CTech IT | Unit 1 | 2.6 - Software Troubleshooting | CSNewbs

    Learn about software errors and troubleshooting methods of solving them. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 2.6 - Software Troubleshooting Exam Board: OCR Specification: 2016 - Unit 1 A software error occurs when a program or process stops working as expected. Software errors usually occur when programs are badly written or if a user inputs unexpected data . Common Faults System Freeze The computer freezes and pressing keys or moving the mouse gives no response . Commonly caused by having too many applications running simultaneously or a virus using too much memory . Unexpected Reboot To try and fix errors, a computer might get stuck in an endless loop of booting and rebooting . Other systems may frequently restart without warning . Stop Error This occurs after a fatal system error when the operating system stops , usually because of a driver software issue . Commonly known as the 'blue screen of death ' on Windows-based systems. Update Error While designed to fix errors, updates can sometimes bring more problems if they interfere with the current software . Troubleshooting Tools for Software Errors Event Viewer (Logs) If a software error does occur, then the same characteristics as a hardware error should be logged , such as the time and date of the error , the user logged in , and the device's problem history . Memory Dump Copies and displays the contents of RAM at the time of a crash to help a technician discover what happened . Baselines Before After A comparison of what the system is like after a crash compared to a fixed point in time beforehand. The baseline can be used to see differences which may have caused the computer to fail . Anti-Virus Checks if malware is running on a device, using up resources and slowing the system down. It could then be quarantined and deleted by the anti-virus. Installable tools can also be downloaded to investigate the system and find the cause of the problem . They may help detect corrupted files , uncover deleted files , and resolve other general hardware or software issues . Q uesto's Q uestions 2.6 - Software Troubleshooting: 1. Describe each of the four common types of software error : a. System Freeze b. Stop Error c. Unexpected Reboot d. Update Error [2 each ] 2. Describe each type of troubleshooting tool and explain how it can be used to discover and fix software errors. a. Event Viewer b. Memory Dump c. Baselines d. Antivirus Software e. Installable Tools [ 2 each ] 2.5 Communication Methods Topic List 2.7 - Protocols

  • Python | 10b - Read & Search Files | CSNewbs

    Learn how to read and search through files in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. Python 10b - Read & Search Files Reading from a File To read and print from a file you must open it in read mode by typing "r" instead of "a". If you are writing and reading in the same program, make sure you close the file in append mode before you open it in read mode . The program below uses the Customers.txt file from the last section. A simple for loop can be used to print each line of the file. The end = "" code just prevents a space between each line. Practice Task 1 Open one of the files that you used in Section 10a and print each line. Example solution: Reading Specific Lines from a File Sometimes it is necessary only to print certain lines. The following example uses a file where I have written a sentence of advice on each line. The user is asked to enter a number between 1 and 6. If they enter 1, the first line of the file is printed. If they enter 2, the second line of the file is printed etc. Remember Python starts counting everything at 0 so each line is a digit less than you would expect . Square brackets must be used to denote the line to print: [1] not (1). The end = "" code is not necessary but removes space after the line. Practice Task 2 Create a text file (saved in the same folder as your Python file) with a list of video games. Ask the user to enter a number between 1 and 10. Print the line for the number that they input. Example solution: Print a Random Line The randint command can be imported and used to print a random line from a file . The example below prints one of the 12 months . The file is opened in read mode and the readlines() command extracts each line , placing them in a list . A random number is then generated between 0 and one less than the total number of lines . This random number is then used to print a line from the extracted list of lines . Python code from random import randint file = open ( "months.txt" , "r" ) lines = file.readlines() random = randint(0,11) print (lines[random]) months.txt January February March April May June July August September October November December potential outputs March December April July If the length of the file is not fixed (e.g. new lines are being added or lines removed ) then the random number generation line can be adapted to use the len command to calculate the current number of lines . This is required to know the upper limit of the random number . random = randint(0,len(lines)-1) Searching Through Files A for loop is used to search through a file , line by line . First, an input line is used to allow the user to enter their search term . If the term that is being searched for is found, then the whole line is printed. The example below uses a variable named found to state if there is a match when the file is searched. If the search term is found, then the found variable is changed to true . If the search term is not found , the found variable remains as false, so the 'no customers found' statement is printed . Practice Task 3 You should have completed Practice Task 2 from Section 10a (the A Level task). Add extra code to that program so that you can search for specific students. Example solution: ⬅ 10a - Open & Write Files 10c - Remove & Edit Lines ➡

  • Python Editor| CSNewbs

    A simple HTML and CSS editor using Code Minrror libraries. Learn how to create simple web pages using HTML. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. Simple HTML & CSS Editor This page is under active development.

  • 5.1 - Data Structures - Eduqas GCSE (2020 Spec) | CSNewbs

    Learn about different data structures such as arrays, lists and records. Also, the difference between static and dynamic data structures and how to design files. Based on the 2020 Eduqas (WJEC) GCSE specification. 5.1: Data Structures & File Design Exam Board: Eduqas / WJEC Specification: 2020 + What is a Data Structure? A data structure is a way of efficiently organising data . There are two general forms of data structures: Static Data Structures The size of a static data structure cannot change e.g. if a data structure has 20 elements, no additional elements can be added or removed. The values of the data elements can be changed, but memory size is fixed when allocated at compile time. Because a static data structure holds a certain number of data elements they are easier to program because the size of the structure and the number of elements never change. An array is an example of a static data structure. Examples: A static data structure could be an array of teams in the Premier League. The data elements will change each year when teams are relegated and promoted but there will always be 20 teams. Dynamic Data Structures The size of a dynamic data structure can change as the program is being run , it is possible to add or remove data elements. Dynamic data structures make the most efficient use of memory but are more difficult to program , as you have to check the size of the data structure and the location of the data items each time you use the data. A list is an example of a dynamic data structure. A dynamic data structure could be a list of all teams in the Premier League that won their last match. Data elements (teams) will be added or removed across the season. Types of Data Structures List A list is a dynamic data structure that has the data elements stored in the order they were originally added to memory . Every data structure starts at 0, not 1 . Lists store data elements in the order they were added, so the first doctor is 0 and the most recent doctor is 12. An example list of the main Doctor Who actors Array An array is a static data structure that can hold a fixed number of data elements . Each data element must be of the same data type i.e. real, integer, string. The elements in an array are identified by a number that indicates their position in the array. This number is known as the index. The first element in an array always has an index of 0 . You should know how to write pseudo code that manipulates arrays to traverse, add, remove and search data. The following steps uses Python as an example. Traversing an Array To traverse (' move through ') an array a for loop can be used to display each data element in order. 'Inserting' a value In an array the size is fixed so you cannot insert new values, but you can change the value of elements that already exist. Overwriting the fourth element (Daphne) with a new value (Laura) will change it from Daphne to Laura. Example code for traversing: Example code for inserting: Output: Output: 'Deleting' a value In an array the size is fixed so you cannot delete values, but you can overwrite them as blank . Overwriting the second element (Shaggy) with a blank space makes it appear deleted. Example code for deleting: Output: Searching an Array For large arrays a for loop is needed to search through each element for a specific value . This example checks each name to see if it is equal to Velma. Example code for searching: Output: Two-Dimensional Array Often the data we want to process comes in the form of a table . The data in a two dimensional array must still all be of the same data type , but can have multiple rows and columns . The two-dimensional array to the right shows the characters from Scooby Doo along with their associated colour and their species. Each value in the array is represented by an index still, but now the index has two values . For example [3] [0] is 'Daphne'. We measure row first , then column . Searching a two-dimensional array: To print a specific data element you can just use the index number like Daphne above. To search for a specific value you will need two for loops, one for the row and another for the values of each row. The example to the right is looking for the value of 'Velma' and when it is round it prints the associated data from the whole row. Example code for printing: Output: Example code for searching: Output: Records Unlike arrays, records can store data of different data types . Each record is made up of information about one person or thing. Each piece of information in the record is called a field (each row name). Records should have a key field - this is unique data that identifies each record . For example Student ID is a good key field for a record on students as no two students can have the same Student ID. Data files are made up of records with the same structure. It would be most efficient for the fields in a record to be stored next to each other so that the data can be read into the record data structure in memory for processing by the CPU. In an exam you may be asked to state and design a data structure for a given scenario. If the data structure can hold values of the same data type you should draw an array , usually a 2D array for multiple rows and columns. Remember that a record is required to store values of different data types . Example questions: "A video gamer has recorded their three lap times in four Mario Kart courses." " State and design the most suitable data structure for this data." A two-dimensional array is most suitable because only one data type ( real ) is stored. "A vet surgery stores data on all dogs and cats including the animal's name, age (in years), weight (in kg) and whether or not it has been vaccinated." " State and design the most suitable data structure for this data for four animals ." A record is most suitable because the data structure requires different data types . Q uesto's Q uestions 5.1 - Data Structures: 1. Give two differences between static and dynamic data structures . [ 4 ] 2. Describe the differences between a list , array and record . [ 3 ] 3. A one-dimensional array looks like this: TigerBreeds("Sumatran","Indian","Malayan,"Amur") Write the code to: a. Print the element with the index of 3. [ 2 ] b. Change Indian to South China. [ 2 ] c. Remove the Amur element. [ 2 ] d. Search through the array for 'Malayan'. [ 2 ] 4. State and design the most suitable data structure for these scenarios: a. For each book in a bookshop, the staff need to record the title, author, number of pages and whether or not it is a signed copy. Include data for three books. [ 3 ] b. Four dieters are recording how many kilograms they have lost each month for 5 months. [ 4 ] 5. Design a file that stores the first initial, surname, age and hair colour of each member of a family. [ 8 ] Designing Data Structures Data is stored in files when it needs to be kept after the program has stopped running . To learn how to write code for file handling (e.g. opening, writing to, reading from and closing files) in Python click here . Designing a file requires more than just the field name (e.g. Name) and data values (e.g. Rebecca). The data type (e.g. string) and any validation checks (e.g. format check) should also be considered. Below is an example file design for a bakery. Designing Files 4.8 Compression Theory Topics 6.1 - Operating Systems

  • 2.1 - Programming Techniques | OCR A-Level | CSNewbs

    Learn about programming constructs such as sequence, iteration and branching, recursion, local and global variables, modularity, functions and procedures, parameter passing by value and by reference, Integrated Development Environment (IDE) tools and object-oriented techniques. Based on the OCR H446 Computer Science A-Level specification. Exam Board: OCR A-Level Specification: Computer Science H446 2.1 - Programming Techniques Watch on YouTube : Programming constructs Recursion Local & global variables Modularity Integrated development environment Object-oriented programming Programming Constructs Sequence , iteration and branching (also called selection ) are the three fundamental programming constructs used to build algorithms . Sequence means that instructions run in a specific order , one after another. Iteration is the repetition of a set of instructions , usually being count-controlled , such as for loops , or condition-controlled , such as while loops or do until loops . Branching (selection ) allows a program to choose between different actions based on a condition , using structures like if , elif , else or switch . YouTube video uploading soon Recursion Recursion is where a function calls itself to solve a problem by breaking it down into smaller , simpler versions of the same problem . Recursion is often used for tasks that naturally fit a 'divide and conquer ' structure , such as quicksort and merge sort algorithms. It is also used for depth-first tree traversals and solving mathematical problems like factorials or the Fibonacci sequence . Compared to iteration , recursion can produce clearer and more elegant solutions , but it may use more memory and can be less efficient if the recursion goes too deep or lacks a proper base case (stopping condition ) , potentially running out of memory . YouTube video uploading soon Local & Global Variables Local variables are created inside a function or block and can only be accessed there , which makes programs safer and easier to debug because changes to the variable cannot affect other parts of the program ; however, they cannot store values that need to be shared across multiple functions . Global variables are declared outside all functions and can be accessed anywhere in the program , making them useful for storing information that many parts of the program need , but they can lead to errors if different functions accidentally change them and can make the program harder to maintain . YouTube video uploading soon Modularity Modularity is the practice of breaking a program into smaller , self-contained parts so each section can be developed , tested and understood independently . Functions and procedures are modular units of code: a function returns a value , while a procedure performs a task without returning a value . When data is passed into a subroutine , it can be passed by value , where a copy of the data is sent so the original cannot be changed , or passed by reference , where the subroutine receives direct access to the original data , allowing it to be modified . YouTube video uploading soon Integrated Development Environment An Integrated Development Environment (IDE ) is software that provides the tools a programmer needs to write , test and debug code in one place . It typically includes an editor for writing and formatting code , syntax highlighting to make keywords and errors easier to spot , and auto-completion to speed up coding . For debugging , an IDE often provides error diagnostics that highlight mistakes , a run-time environment to execute the program , and tools like breakpoints and step-through execution that allow the programmer to pause the program and inspect variables to find and fix bugs more easily . YouTube video uploading soon Object-Oriented Programming Object-oriented techniques are a way of designing programs by modelling them as collections of objects , each representing something with its own data and behaviours . These objects are created from classes , which act like blueprints describing the attributes (data ) and methods (actions ) an object will have . It uses key principles such as encapsulation (keeping an object’s data and methods together and protected ), inheritance (allowing classes to share and reuse features ) and polymorphism (enabling objects to behave differently ). These techniques make large programs easier to organise , maintain and extend by encouraging reusable , modular and well-structured code . 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 Constructs: sequence, iteration, selection (branching), if / elif / else, select (switch) case Recursion & Iteration: count-controlled loop, condition-controlled loop, recursion, base case Variables: local variable, global variable Modularity: function, procedure, parameter, pass by value, pass by reference Integrated Development Environment (IDE) Object Oriented Programming (OOP): class, object, method, attribute, inheritance, encapsulation, polymorphism D id Y ou K now? Roblox Studio is a free IDE for making Roblox games using the programming language Lua . With over 70m daily Roblox players , games built in Roblox Studio can reach a larger audience than many mainstream game engines . 1.1 - Computational Thinking A-Level Topics 2.2 - Computational Methods

  • HTML Guide 10 - More Pages | CSNewbs

    Learn how to create more HTML pages and link them together using the anchor tag. 10. More Pages HTML Guide Watch on YouTube: Create a New Page Create a new page by either clicking the new page icon in Notepad ++ or selecting File then New . Then you need to save your new page with an appropriate name as a HTML file . Create a new page, save it and add information to it. Your new page needs the same essential tags as your original page: Then you can add the rest of your content . Link to Other Pages The tag is used to link between pages , just like it is used to hyperlink to other websites. Make sure you type your web pages exactly as you have saved them. Make sure all of your web pages are saved in the same folder . Include links between pages on each new page. A link to the second page. Don't forget a link back to your homepage on each new page. Why not add more pages to make your website more detailed? 9. Colours & Fonts HTML Guide

  • Python | 7b - Functions | CSNewbs

    Learn how to create and use functions in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 7b - Functions What is a Function? A function is a subroutine that takes one or more values from the main program and returns a value back. For example, transferring over a sphere’s radius from the main program for the function to calculate a surface area and then return that value to the main program. The two key differences between procedures and functions are: A function uses parameters to transfer data from the main program into the function. A function returns a value to the main program. Writing Functions A function is written the same way as a procedure but it uses parameters . In the example below the parameters are num1 and num2 which are sent from the main program to be used in the function . The return command is used to send a value back to the main program . Below is another example of a function that takes the radius of a sphere and works out the area in a separate function . The area is returned to the main program and printed. Subroutines can be reused and called with different parameters . The program below repeatedly takes an integer input and adds it to a total in a function that is then returned and printed. Practice Task Create a program similar to the sphere example above, this time to work out the volume of a cylinder. In the main program ask the user to enter the cylinder's radius and then its height. The actual calculation should be done in a function and returned to the main program. The calculation for a cylinder's volume is: pi x (radius x radius) x height Extension: Use the round command from section 9b to round the number to 2 decimal places. Example solution: Using Subroutines as a Menu Subroutines are often used to split programs up and give users a selection of options . Subroutines are used for this purpose because they are separate , making it easier to code and manage a program . The example below for a simplified online banking system uses separate subroutines accessible within a while true loop . Depending on the option chosen by the user, the appropriate subroutine will be called . Instead of a further practice task here, Task 4 of the Section 7 Practice tasks page challenges you to make a similar program using multiple subroutines. ⬅ 7a - Proced ures Section 7 Practice Tasks ➡

  • App Inventor 2 | Variables | CSNewbs

    Learn how to use App Inventor 2 to create simple programs. Try to complete tasks 4, 5 and 6 on this page. Perfect for Key Stage 3 students to experiment with block coding, objects and properties. App Inventor Tasks 4, 5 & 6 - Using Variables This page will teach you how to make three simple apps that use variables . These apps will prepare you for the final program - the Pop-up Blob game. App #4 - Button Masher The first app to make is a simple program that counts how many times a button is pressed (but don't press it too much! ) This app will introduce you to using variables in App Inventor. Open App Inventor 2 (use the button below) and create a new project. You will need to log in with a Google account. App Inventor 2 Firstly, grab a button and two labels and place them in the Viewer . Using the Properties tab, you need to make the following changes: Button Text to 'Press Me!' Button Height to 60 pixels and Width to 'Fill parent...' Label 1 Text to 'Number of Presses' Label 2 Text to '0' Both Label 1 and Label 2 Width to 'Fill parent...' Both Label 1 and Label 2 TextAlignment to 'centre : 1' In the Components tab change the component names to be easier to code later. Switch to Blocks layout and drag an initialize global to block into the centre. In the blank space type 'Presses' - this is the name of the variable that will store how many times the button has been pressed. Drag a 0 block from Math. This will set the number of presses to 0 when the app starts. Drag a when ButtonPresses Clicked from the ButtonPresses section and add the necessary code inside. This code increases the variable value of Presses by 1 every time the button is clicked. It also changes the LabelPresses text to display the number of presses. Improve Your App As you will have seen in the video at the top, I programmed the app to go a bit crazy when 35 presses were recorded. In the code below I have shown how to use an if then block to check if the number of presses is 35. If it is then I have made the button invisible - this is an important feature we will use in later programs. Copy this code and add the following features to the then part of the if statement: Set the background colour to black. Change the Label1 Text Colour to white. Change the Label1 Text Size to 40. Change the Label1 Text to 'You broke it...' Program 4 Complete! App #5 - Timer The second app to make is a timer that counts up one second at a time. It also needs a reset button that sets the timer back to 0 again. It will introduce you to the clock component and enabling / disabling components. Open App Inventor 2 (use the button below) and create a new project. You will need to log in with a Google account. App Inventor 2 The code for this program is straightforward; it will take more effort getting the layout right. In the Palette tab, drag a HorizontalArrangement from the Layout section. It will look like an empty grey box at first. Grab a Button as well and place it underneath. Now drag two labels into the grey box and place the second one directly after the first, it may take a few attempts to get them to appear side by side like below: The last component to drag over is Clock (it is in the Sensors section in the Palette tab). It will go into its own section underneath: Change the name of some of the components so that they make more sense. Now to make some changes in the Properties tab. You should know enough by now to work out how to change your components so that it looks like this in your Viewer : Change your layout to Blocks and add the code blocks to the right. This code makes the Label named Seconds update by 1 every second, just like a timer. The code to the left will make the Label named Seconds reset to 0 when the button is pressed. Improve Your App As you will have seen in the video at the top of this task, I added a pause/unpause button that will set the enabled feature of the timer to true or false. You will need to complete the following steps (I've been deliberately vague to make it a challenge - break it down into small steps and use the colours to help you): Add a new button. Add code that, when the new button is clicked , checks if the TimerEnabled is true . If it is, then change TimerEnabled to false . Else change it to true . Now you also need to change the Text of the Button to read either "Pause" or "Unpause" . Program 5 Complete! App #6 - Windy Day The third app to make is an app that blows leaves around your screen. It will introduce you to random numbers, the canvas and coordinates . Open App Inventor 2 (use the button below) and create a new project. You will need to log in with a Google account. App Inventor 2 In the Palette tab, drag a Canvas from the Drawing and Animation section. A Canvas allows sprites (objects) to move around inside of it. In Properties , change the Height and Width of Canvas to 'Fill parent...' for both, so it fills the whole screen. In the Palette tab, drag over five ImageSprites from the Drawing and Animation section and drop them anywhere inside the canvas. Download the leaf picture with all App Inventor images on the basics page here . Upload the leaf image it in the Media tab. In the Components tab change the names of your ImageSprites to be leaf1, leaf 2 etc. For each leaf sprite, in the Properties tab, change the Picture to the leaf you just uploaded and change Height and Width to 30 pixels each. Finally, in the Palette tab, in the Sensors section, drag over a Clock . Your Viewer should look like the image to the left. X axis Y axis 0 300 500 Now for an explanation of coordinates. Each sprite (leaf) has an x coordinate (horizontal) and a y coordinate (vertical). For example, the leaf in the top right would have coordinates of x = 270 and y = 100. Can you work out approximately what the other leaves coordinates would be? What the code blocks below do is randomise the x and y coordinates for leaf1 every second. The word integer means a whole number . Use this code and add to it to make all 5 leaves randomly change coordinates. Improve Your App Add a pause / unpause button, just like in the Timer app that pauses the timer so that the leaves stop blowing (and starts them blowing around again too). Find a nice picture (maybe of a park?) online and upload it in the Media tab. Set this as the Canvas BackgroundImage . Add an audio file of some whooshing (why not record it yourself?). Program 6 Complete! Task 7 KS3 Home

© CSNewbs 2026

The written, video and visual content of CSNewbs is protected by copyright. © 2026
bottom of page