top of page

Search CSNewbs

293 results found with an empty search

  • 2.1.1 - Computational Thinking | OCR A-Level | CSNewbs

    Based on the OCR Computer Science A-Level 2015 specification. Exam Board: OCR 1.1 - Computational Thinking Specification: A-Level 2015 An instruction set is a list of all the instructions that a CPU can process as part of the FDE cycle . CPUs can have different sets of instructions that they can perform based on their function. The two most common instruction sets are the simpler RISC (Reduced Instruction Set Computer ) and more complicated CISC (Complex Instruction Set Computer ). Instruction Sets This page is still being updated. Graphical Processing Unit What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Multicore & Parallel Systems What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Multicore & Parallel Systems What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Q uesto's Q uestions 1.1 - Computational Thinking: 1. What is cache memory ? [ 2 ] Theory Topics 2.1a - Recursion & Variables

  • Greenfoot Guide #5 | Play Sounds | CSNewbs

    Learn how to play sound files in Greenfoot. Part 5 of the Greenfoot Tutorial for the Eduqas / WJEC GCSE 2016 specification. 5. Play Sounds 1. Check the Sounds Folder Greenfoot Tutorial Sound files must be placed the ' sounds ' folder of your Greenfoot project to be used in the game. In the Component 2 exam of the WJEC / Eduqas 2016 specification , an audio file will be placed in the sounds folder already . For this example game you can download the audio clips to the right and paste them into your sounds folder . Watch on YouTube: Click the audio icon to download a zip folder of the two sound files below . Copy the files into the sounds folder of your Greenfoot project . < Part 4 - Remove Objects 2. Add the playSound Method Add the code to play the sound at the same time as when the collectible object is removed . The name of the file and its extension (e.g. .wav or .mp3 ) must be written in speech marks after the playSound method. Part 6 - The Counter >

  • 4.5 - Character Sets & Data Types - GCSE (2020 Spec) | CSNewbs

    Learn about the main character sets - ASCII (American Standard Code for Information Interchange) and Unicode. Also, discover the five data types - character, string, integer, real and Boolean. Based on the 2020 Eduqas (WJEC) GCSE specification. 4.5: Character Sets & Data Types Exam Board: Eduqas / WJEC Specification: 2020 + What is a Character Set? A character set is a table that matches together a character and a binary value . Character sets are necessary as they allow computers to exchange data . Two common character sets are ASCII and Unicode . ASCII Unicode ( American Standard Code for Information Interchange ) 0100 0001 0100 0010 0100 0011 Uses Binary 128 Tiny Set of Characters Less Memory Required Per Character U+0042 U+0055 U+004E Uses Hexadecimal 137,000+ Large Set of Characters More Memory Required per Character What are the different data types? When programming, variables should be given appropriate data types . Character String Integer A single character , such as a letter, number or punctuation symbol. Examples: A sequence of characters , including letters, numbers and punctuation. Examples: A whole number . Examples: T 8 ? Harry Waters 14:50pm Ice Age 4 475 -8432 56732 Real Boolean Telephone numbers are always stored as a string , not an integer. True / False Yes / No 0 / 1 An answer that only has two possible values . Examples: A decimal number . Examples: 65.3 -321.1234 909.135 Be careful with punctuation. 32.10 is a real but £32.10 is a string. Q uesto's Q uestions 4.5 - Character Sets & Data Types: 1. What is a character set and why are they needed ? [ 2 ] 2. Describe 3 differences between ASCII and Unicode . [6 ] 3. State the 5 different data types . [ 5 ] 4. State which data type is most suitable for the following variables: a. Age [ 1 ] b. Surname [ 1 ] c. Height (in metres) [ 1 ] d. First Initial [ 1 ] e. Phone number [ 1 ] f. Right-Handed? [ 1 ] 4.4 Arithmetic Shift Theory Topics 4.6 - Graphical Representation

  • OCR CTech IT | Unit 1 | 2.1 - Software Types | CSNewbs

    Learn about the advantages and disadvantages of different types of software including open-source, closed-source, off-the-shelf and bespoke. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 2.1: Software Types Exam Board: OCR Specification: 2016 - Unit 1 Software refers to the programs and applications that run on a computer system. Open Source Software Source code is the software code written by programmers . If the software is open source it means that users can view and modify the code . Linux, Python and Firefox are examples of open source software. Benefits Drawbacks Because the source code is available to edit , it can be customised to the organisation's needs . Often shared in the public domain so users can work together to modify, debug and improve a product. Unwanted features can be removed to make the software run faster . There are security risks - some editors may add malicious code to the program. Open source software is often low in price and sometimes free. It may be difficult to receive support as development is often distributed between people in different locations. The code may be prone to errors as it may not have been tested fully. It requires technical skills to be able to adapt source code efficiently and to maintain the code . Closed Source Software If the software is closed source it means the code is restricted for users to view or modify . You buy the right to use the software but you don't actually own it. Microsoft Office, Fortnite and Spotify are examples of closed source software. Closed source software is also known as proprietary software because it is another company's property and protected by law. Benefits Drawbacks The code is well tested and has been professionally developed. Updates will generally be secure . Users must rely on the company to provide updates and fix issues. This might be infrequent or stop completely. The company can be held to account if it does not perform as listed in the terms and conditions upon purchase. Often not free (see Freeware below for free closed source software). Most developers will provide some form of help/support . Users cannot modify, debug or improve the code for their own benefit. Off-the-Shelf Software This is any software made for general use , with features that can be used in different ways and for different purposes . Examples include office software (e.g. Microsoft Office), video games (e.g. Minecraft) and image editors (e.g. Adobe PhotoShop). Back before internet downloads, people had to actually go to shops and buy software off the shelf and install it at home, hence the name. Benefits Drawbacks Should have been tested thoroughly so users can be confident that features will work as expected . Secure updates will be regular. It can be expensive to purchase some software , especially for a single user rather than a business. Some software, such as anti-virus protection, requires yearly licenses . It can be cheaper to purchase than bespoke software as it is not customised for a specific user or organisation. The software may contain additional features that the user / organisation doesn’t need which can reduce the performance of the system. The end users might be familiar with the software and trust the company (e.g. Microsoft Word). Bespoke Software This is any software that has been custom made for a specific organisation or user. For example, programmers might be hired by a company to create software for a specific task. Hospitals and schools use bespoke software to track and manage patients / students. It can be expensive to commission bespoke software as programmers and user interface designers need to be hired and there could be issues with rights to any created software. Benefits Drawbacks The software is built to the company's requirements , it is unique to their needs. Unwanted features can be removed to make the software run faster . Bespoke software is expensive to develop because it is tailor-made for the company. Staff may require training on using the system because it is unique . The look of the software (e.g. design & layout ) can be customised to fit the company's image. Because it has been custom-made, the original programmers may be needed to maintain the software and fix errors . Shareware This software allows the user to trial the program for a limited time before forcing them to buy the product or stop using it. For example, WinRAR is utility software that asks the user to buy the full version after 40 days. This allows the user to get a taste of what the software offers before choosing whether to buy it fully or not . Freeware This is software that is freely available to download and use . These are usually closed-source software that earn money through adverts or additional purchases. Rights to the software remain with the author despite the free access. App developers may release their app as freeware to allow users to try the software and then encourage them to purchase a full version with more features. Unlike shareware, the user should be able to keep using the product for free indefinitely, though their version may have features restricted or adverts enabled. Examples of freeware software include iTunes , Clash of Clans and Adobe Acrobat Reader (for PDFs). Embedded Software An embedded system is when a smaller computer system is installed within a larger device , such as a washing machine, traffic light or car. Embedded systems have a dedicated purpose and often run in real-time . Because of the small size, the embedded software will usually have memory and storage restrictions . Q uesto's Q uestions 2.1 - Software Types: 1. Describe the 7 types of software , listing the advantages and disadvantages of each. a. Open Source b. Closed Source c. Off-the-Shelf d. Bespoke e. Shareware f. Freeware g. Embedded [6 each ] 1.8 & 1.9 - Number Systems Topic List 2.2 - Applications Software

  • 11 Graphical User Interface | CSNewbs

    Learn how to create and use a simple graphical user interface (GUI) in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. Python 11 - GUI Graphical User Interface In Python, you don’t have just to use a text display; you can create a GUI (Graphical User Interface ) to make programs that look professional. This page demonstrates the basic features of Python’s built-in GUI named tkinter . You can add images, labels, buttons and data entry boxes to develop interactive programs . Hyperlinked sections covered on this page: Setup: Title, Size & Background Creating Elements: Labels, Entry Boxes, Buttons, Images, Message Boxes Displaying Elements: Pack, Place, Grid Inputs & Outputs GUI Tasks Setup Setup: Title, Size & Background Firstly, import the tkinter command and set tkinter.Tk() to a variable such as window . GUI code can be quite complicated with multiple elements so it is sensible to use a comment for each section. Setting the title , size and background colour of your window is optional but can be easily set up at the start of your code. The .geometry() command sets the size of the window. The first number is the width , and the second number is the height . The .configure() command can be used to set the background colour . For a full list of compatible colours, check here . import tkinter #Setting up the Window window = tkinter.Tk() window.title( "Graphical User Interface" ) window.geometry( "400x400" ) window.configure(background = "lightblue" ) import tkinter #Setting up the Window window = tkinter.Tk() window.title( "Example Number Two" ) window.geometry( "300x400" ) window.configure(background = "darkorchid3" ) Creating Elements Creating Elements: Labels, Entry Boxes, Buttons, Radio Buttons, Images, Message Boxes Labels label1 = tkinter.Label(window, text = "Hello there" ) label1 = tkinter.Label(window, text = "Hello there" , fg = "black" , bg = "lightblue" , font = ( "Arial" , 12)) Simple label with default formatting: Label with custom formatting: No elements will appear in your window until you write code to put them there. See the 'Displaying Elements' section further down. Entry (Text) Boxes Simple entry box with default formatting: entry1 = tkinter.Entry(window ) Entry boxes will appear blank , the 'Example Text' shown in the images has been typed in. Entry box with custom formatting: entry1 = tkinter.Entry(window, fg = "blue" , bg = "gray90" , width = 12, font = ( "Arial" ,12)) Buttons The command property of a button is a subroutine that will be called when the button is pressed . The subroutine must be written above the button creation code. def ButtonPress (): #Code here runs when the button is pressed button1 = tkinter.Button(window, text = "Click Me" , fg = "black" , bg = "gold2" , command = ButtonPress) Radio Buttons The Radiobutton element is a multiple-choice option button . A variable needs to be created to track which option has been selected, in this example it is ‘choice ’. Each radio button needs to be linked to the variable and given a unique value (e.g. 0, 1, 2). The radio button with the the value of 0 will be automatically selected when the window opens . Although not shown below, the .set() command can also be used to select a specific radio button , e.g. choice.set(2) . choice = tkinter.IntVar() radio1 = tkinter.Radiobutton(window, text = "Breakfast" , variable = choice, value = 0) radio2 = tkinter.Radiobutton(window, text = "Lunch" , variable = choice, value = 1) radio3 = tkinter.Radiobutton(window, text = "Dinner" , variable = choice, value = 2) Message Boxes You need to import messagebox from tkinter before you can use message boxes . You only need to do this once in your program and it sensible to have it at the very start after you import tkinter (and any other libraries). from tkinter import messagebox tkinter.messagebox.showinfo( "Information" , "Welcome to the program!" ) tkinter.messagebox.showerror( "Error" , "There is a problem with the program." ) if (tkinter.messagebox.askyesno( "Warning" , "Have you understood the instructions?" )) == True : tkinter.messagebox.showinfo( "Warning" , "Thank you for understanding." ) else : tkinter.messagebox.showinfo( "Warning" , "Please read the instructions again." ) Yes / No Message Box Clicking Yes (True ) Clicking No (False ) Images Tkinter supports the image file types .png and .gif . The image file must be saved in the same folder that the .py file is. Resize the image in separate image editing software such as Paint to a specific size . Tkinter does not support all image file types, such as .jpg. Use an application like Microsoft Paint to save an image with a different extension like .png. photo1 = tkinter.PhotoImage(file = "hamster.png" ) photoLabel1 = tkinter.Label(window, image = photo1) An image can be turned into a clickable button rather than a label. def ButtonPress (): #Code here runs when the button is pressed photo1 = tkinter.PhotoImage(file = "hamster.png" ) button1 = tkinter.Button(window, image = photo1, command = ButtonPress) photo1 = tkinter.PhotoImage(file = "hamster.png" ) window.iconphoto( True , photo1) The icon of the window can be changed to an image . Displaying Elements: Pack, Place and Grid Pack .pack() puts the element in the centre of the window, with the next packed element immediately below. window.mainloop() should always be your last line of code in every program, after you have packed, placed or gridded your elements. Displaying Elements labelAdd.pack() buttonAdd.pack() labelMinus.pack() buttonMinus.pack() window.mainloop() Place The .place() command allows an element to be placed in specific coordinates , using x (horizontal ) and y (vertical ) axes. labelAdd.place(x = 25, y = 15) buttonAdd.place(x = 12, y = 35) labelMinus.place(x = 90, y = 15) buttonMinus.place(x = 83, y = 35) window.mainloop() Grid The .grid() command is used to create a grid system to set the row and column . Remember Python starts counting at 0 . You can use padx and pady to add extra space (x is horizontal , y is vertical ). labelAdd.grid(row = 0, column = 0, padx = 10, pady = 5) buttonAdd.grid(row = 1, column = 0, padx = 10) labelMinus.grid(row = 0, column = 1, padx = 10, pady = 5) buttonMinus.grid(row = 1, column = 1, padx = 10) window.mainloop() Inputs & Outputs Inputs and Outputs .config to Change an Element .config() overwrites the property of an element. It can be used with elements such as labels and buttons to change how they appear. label1.config(text = "Warning!" ) The example below (not showing setup and packing) adds 1 to a total variable when the button is pressed . Config is used in two ways: to display the updated total and to change the background of the label to green. def AddOne (): global total total = total + 1 labelTotal.config(text = total, bg = "green" ) total = 0 buttonAdd = tkinter.Button(window, text = "Add" , command = AddOne) Below is a similar program in full that increases or decreases and displays a total when the buttons are pressed . #Setup import tkinter window = tkinter.Tk() total = 0 #Button Presses def AddOne (): global total total = total + 1 labelTotal.config(text = total) def MinusOne (): global total total = total - 1 labelTotal.config(text = total) #Create Elements labelTotal = tkinter.Label(window, text = total, font = ( "Arial" ,14)) buttonAdd = tkinter.Button(window, text = "+" , width = 6, bg = "green" , command = AddOne) buttonMinus = tkinter.Button(window, text = "-" , width = 6, bg = "red" , command = MinusOne) #Display Elements buttonAdd.pack() buttonMinus.pack() labelTotal.pack() window.mainloop() .get to Input a Value .get() returns the value of an element such as an entry box , label or the choice variable if using radio buttons . The value of the element should be stored in a variable so it can be used elsewhere, for example: name = entryName.get() number = int (entryNumber.get()) Use int when getting a value that is an integer : The full program example below checks that the values typed into the username and password entry boxes are correct . Error Messages #Setup import tkinter from tkinter import messagebox window = tkinter.Tk() window.title( "Login" ) #Button Presses def CheckDetails (): username = entryUsername.get() password = entryPassword.get() if username == "Bob Bobson" and password == "cabbage123" : tkinter.messagebox.showinfo( "Success" , "Welcome " + username) else : tkinter.messagebox.showerror( "Invalid ", "Those details are incorrect." ) #Create Elements labelUsername = tkinter.Label(window, text = "Username:" ) labelPassword = tkinter.Label(window, text = "Password" ) entryUsername = tkinter.Entry(window) entryPassword = tkinter.Entry(window) buttonLogin = tkinter.Button(window, text = "Login" , command = CheckDetails) #Display Elements labelUsername.grid(row = 0, column = 0) entryUsername.grid(row = 0, column = 1) labelPassword.grid(row = 1, column = 0) entryPassword.grid(row = 1, column = 1) buttonLogin.grid(row = 2, column = 0) window.mainloop() .bind for Key Presses (& Close Window) .get() will run a specific function when a certain key is pressed. The name of the key must be surrounded by < > brackets and speechmarks . Any associated subroutine of a key bind will need a parameter : event has been chosen and set to None . The code below closes the window using the .destroy() command when the Esc key is pressed. def Close (event = None ): window.destroy() window.bind( "" , Close) The code below will activate the button (and display a message box) by clicking on it but also by pressing the Enter ( Return ) key . def ButtonPress (event = None ): tkinter.messagebox.showinfo( "Success" , "The button was activated" ) button1 = tkinter.Button(window, text = "Press Me" , command = ButtonPress) window.bind( "" , ButtonPress) GUI Tasks GUI Programs to Make Making a program using a GUI can be overwhelming and you must decompose the problem - take it step by step : Import tkinter and create the window (set the title, size and background colour). Create the elements you will need such as labels , buttons and entry boxes . Put the components in the window using pack , place or grid . Write the subroutines for any button presses . These are written at the top of the program after the window setup. Consider your variables - do any need to be set at the start ? Have you made them global if they’re needed within a subroutine ? Put window.mainloop() as the final line of code, only have it once. Use #comments in your code to break up the different sections, the key four sections are shown below. #Setup #Button Presses #Create Elements #Display Elements GUI Task 1 (Random Number Generator ) Generate a random number between 1 and 100 when the button is pressed and display it in a label. Extension idea: Use entry boxes to allow the user to manually input the minimum and maximum value. Example solution: GUI Task 2 (Currency Exchange ) Enter a decimal value and convert it from British pounds to American dollars. You can search for the current exchange rate. Extension idea: Show the conversion rate for other currencies such as Euros and Japanese Yen. Example solution: GUI Task 3 (Random Quote Generator ) Create a list of quotes and use the choice command from the random library to select one to be displayed in a label when the button is clicked. Extension idea: Have a separate text box and button to add more quotes to the list. Example solution: GUI Task 4 (Colour Changer ) When the button is clicked change the background colour of the button with .config to the RGB colour code in the entry box. This should be # followed by 6 hexadecimal values (0-9, A-F). Extension idea: Have an error pop up in a message box if the colour code is incorrect - it must be exactly 7 characters long and start with a hashtag. Example solutions: GUI Task 5 (Class Captain Votes ) Use radio buttons to vote for different candidates in a class vote. Use an if statement when the button is pressed to check which radio button is selected using .get() and the variable you've assigned to the radio buttons ('choice' if you've followed the code in the radio buttons section on this page). Use .config to overwrite a label's value. Remember any variables you want to use in subroutines must be globalised. Extension idea: Stop the count after a certain number - e.g. 30 votes recorded. Example solution: ⬅ Section 10 Practice Tasks 12 - Error Handling ➡

  • 5.2 - Moral & Ethical Issues | OCR A-Level | CSNewbs

    Based on the OCR Computer Science A-Level 2015 specification. Exam Board: OCR 5.2 - Moral & Ethical Issues Specification: A-Level 2015 An instruction set is a list of all the instructions that a CPU can process as part of the FDE cycle . CPUs can have different sets of instructions that they can perform based on their function. The two most common instruction sets are the simpler RISC (Reduced Instruction Set Computer ) and more complicated CISC (Complex Instruction Set Computer ). Instruction Sets This page is still being updated. Graphical Processing Unit What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Multicore & Parallel Systems What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Multicore & Parallel Systems What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Q uesto's Q uestions 5.2 - Moral & Ethical Issues: 1. What is cache memory ? [ 2 ] 5.1 - Computer Legislation Theory Topics

  • 2.3.1b - Big O Notation | OCR A-Level | CSNewbs

    Based on the OCR Computer Science A-Level 2015 specification. Exam Board: OCR 3.1b - Big O Notation Specification: A-Level 2015 An instruction set is a list of all the instructions that a CPU can process as part of the FDE cycle . CPUs can have different sets of instructions that they can perform based on their function. The two most common instruction sets are the simpler RISC (Reduced Instruction Set Computer ) and more complicated CISC (Complex Instruction Set Computer ). Instruction Sets This page is still being updated. Graphical Processing Unit What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Multicore & Parallel Systems What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Multicore & Parallel Systems What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Q uesto's Q uestions 3.1b - Big O Notation: 1. What is cache memory ? [ 2 ] 3.1a - Algorithm Design Theory Topics 3.1c - Stacks, Queues & Lists

  • 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.3.1a - Object Oriented Programming | OCR A-Level | CSNewbs

    Based on the OCR Computer Science A-Level 2015 specification. Exam Board: OCR 3.1a - Algorithm Design Specification: A-Level 2015 An instruction set is a list of all the instructions that a CPU can process as part of the FDE cycle . CPUs can have different sets of instructions that they can perform based on their function. The two most common instruction sets are the simpler RISC (Reduced Instruction Set Computer ) and more complicated CISC (Complex Instruction Set Computer ). Instruction Sets This page is still being updated. Graphical Processing Unit What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Multicore & Parallel Systems What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Multicore & Parallel Systems What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . Q uesto's Q uestions 3.1a - Algorithm Design: 1. What is cache memory ? [ 2 ] 2.2b - Object Oriented Programming Theory Topics 3.1b - Big O Notation

  • Greenfoot Guide #6 | Counter | CSNewbs

    Learn how to add a counter to Greenfoot to keep track of the score. Learn how to add and subtract points to the counter. Part 6 of the Greenfoot Tutorial for the Eduqas / WJEC GCSE 2016 specification. 6. The Counter Greenfoot Tutorial 1. Import the Counter The counter class can be imported into your Greenfoot world. Select Edit in the main Greenfoot window then ' Import Class... ' and choose Counter . Watch on YouTube: The Counter class will appear in the Actor classes list . Right-click on the Counter, choose the ' new Counter() ' option and drag it into the world. Now right-click on the background and select 'Save the World' once you have dragged the counter into the world. 2. Increase the Counter by 1 Two lines of code are required to increase the counter . Add this code when your main character is removing the collectible object . This code allows your main character to access the 'add' method from the Counter class . The method 'add ' just increases the value of the counter by the number in the brackets . To decrease the counter , type a negative value in the brackets, such as -1 . < Part 5 - Play Sounds 3. Compile and Run Click the Compile button at the top of the code editor . Then you can go back to the main Greenfoot window and click Run to test if your counter increases . Click on me if you've got an error that you're stuck with. Part 7 - Extension Ideas >

  • 2.3 - Units - OCR GCSE (J277 Spec) | CSNewbs

    Learn about different data units of storage from bit up to petabyte, as well as data capacity calculations. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 2.3: Data Units Exam Board: OCR Specification: J277 Watch on YouTube : Units of Data Storage Capacity Requirements All computer systems communicate , process and store data using binary . Binary is a number system consisting entirely of 0s and 1s . Why do computers use binary? Computer systems consist of billions of tiny transistors which are switches that only have two values - on (1 ) or off (0 ). Therefore all data must be represented and processed in this way. Everything that a computer needs to process must be converted into a binary format including text , images , videos and audio . 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 Units of Data Storage 0 / 1 All data in a computer system is made up of bits . A single bit is a 0 or a 1 . 4 bits (such as 0101 or 1101) is called a nibble . 1,000 bytes is called a kilobyte . A kilobyte can store a short email . A 8 bits is called a byte . A byte can store a single character . 1,000 kilobytes is called a megabyte . A megabyte can store about a minute of music . 1,000 megabytes is called a gigabyte . A gigabyte can store about 500 photos . 1,000 terabytes is called a petabyte . A petabyte can store about 1.5 million CDs . 1,000 gigabytes is called a terabyte . A terabyte can store about 500 hours of films . Calculating Data Capacity Requirements It is important to be able to calculate the required storage capacity for a given set of data . Example: A local DJ has a USB memory stick with a capacity of 32GB . There is currently only 9GB of space remaining . Each song is 6MB . How many songs can be stored on the remaining space of the USB stick? Solution: Because each song is recorded in megabytes but the USB stick capacity is measured in gigabytes , the values must be converted into the same storage unit . 9GB x 1000 = 9000MB 9000MB ÷ 6MB = 1,500 songs Q uesto's Q uestions 2.3 - Data Units: 1. Explain why computer systems use binary to represent data. [ 2 ] 2. Put the following data storage units in order from smallest to largest : a . kilobyte - gigabyte - byte - megabyte - nibble - bit [3 ] b. gigabyte - petabyte - kilobyte - byte - terabyte - megabyte [ 3 ] 3. A hard drive contains 25GB of remaining available storage space. Tim is an animator backing up video files. Each file is 200MB . How many files can he fit on the hard drive? [ 2 ] 4. Samantha is a musician. She has compressed each song to 900KB . Her USB memory stick contains 1.2GB of free storage. How many songs can she fit on the USB stick? [ 2 ] 5. A CD has a capacity of 650MB . How many 0.2GB audio files can be stored on the CD? [ 2 ] 0101 2.2 - Secondary Storage Theory Topics 2.4a - Number Systems

  • HTML Guide 9 - Colours & Fonts | CSNewbs

    Learn how to use the style tags in an HTML document to edit the background colour and font text and colour. 9. Style (Colours & Fonts) HTML Guide Watch on YouTube: Before you add any colours or font styles, you need to add tags. The style tags must be written within your head of your HTML document! Add them below your title tags: Add the

© CSNewbs 2025

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