top of page

Search CSNewbs

284 results found with an empty search

  • Python | 5d - Colorama | CSNewbs

    Learn how to change the colour of text in Python using the colorama library. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 5d - COlorama What is Colorama? Colorama is a library that allows the colour of text to be changed. Information about the library can be found on the Python Package Index (PyPi) website . Copyright of the library is held by Jonathan Hartley & Arnon Yaari. Colorama can be imported when using some online editors like Replit . Colorama is not available as a default library on the standard Python offline editor (IDLE) . Using Colorama The three main commands using Colorama are: Fore to change the text colour. Back to change the highlight colour. Style to make the text appear dim or bright. from colorama import Fore print (Fore. GREEN + "Hello There" ) Hello There from colorama import Back print (Back.YELLOW + "Goodbye Now" ) Goodbye Now from colorama import Style print (Style.DIM + "Hi Again" ) Hi Again There are 8 possible colours to choose with the Fore and Back commands. You must write the colour name in CAPITAL LETTERS . BLACK CYAN GREEN MAGENTA RED WHITE YELLOW There is also the RESET option, e.g. Fore.RESET The 2 options to choose with the Style command are DIM and BRIGHT . You can also use Style.RESET_ALL Colorama Task 1 ( Traffic Lights) Create a simple traffic light program . The user is prompted for an input . Typing "GO " will output a suitable message in GREEN , typing "WAIT " will output a message in YELLOW and typing "STOP " will output a response in RED . Example solutions: What should the driver do? STOP You must stop your car. What should the driver do? GO It is safe to continue driving. ⬅ 5c - Date & Tim e 5e - M ore Libraries ➡

  • Expansion Cards | Key Stage 3 | CSNewbs

    Learn about two important expansion cards that can be connected to the motherboard - graphics cards and sound cards - and how they work. Expansion Cards PCI slots What are expansion cards? Expansion cards are additional components that you plug into the motherboard’s expansion slots to add or enhance features . The slots are called PCI (on older computers ) or PCIe (on newer models ). Common types are graphics cards (video ), sound cards (audio ), network cards (internet ) and capture cards (streaming ). Graphics Card A graphics card processes images , videos and 3D graphics so they look smooth and realistic . It is used for gaming , video editing , 3D modelling and Virtual Reality (VR ). It has its own processor - the Graphics Processing Unit (GPU ) - and dedicated memory (VRAM ), so it doesn’t overload the CPU or RAM . Modern graphics cards can also handle tasks like artificial intelligence (AI ) and bitcoin mining . Graphics cards usually have a cooling system, like a fan , so it doesn't overheat. The graphics processing unit ( GPU ) is a chip that renders images and video. The graphics card has ports such as HDMI or DisplayPort to connect monitors or TVs. The PCIe connector allows the graphics card to slot onto the motherboard. Sound Card The DAC ( Digital-to-Analogue Converter ) converts digital data (1s and 0s) from the computer into analogue sound waves for speakers/headphones. The ADC ( Analogue-to-Digital Converter ) converts analogue input (like voice from a microphone) into digital data the computer understands. Jacks are small round sockets where you plug in audio devices like headphones, microphones, or speakers. The PCIe connector allows the sound card to slot onto the motherboard. A sound card improves the quality of audio input/output compared to the motherboard’s built-in sound . They are not needed by most users , because of the motherboard's built-in sound , but they are used by music production , gaming or professional audio work . It can support surround sound systems , high-quality microphones , and musical instruments using jacks (audio ports ). Integrated cards Built directly into the motherboard . Cheaper , uses less power and is good enough for basic tasks (e.g. web browsing , watching videos and office work ). Shares the computer’s RAM and processor (CPU ) instead of having its own . An example is integrated graphics on a laptop for browsing and schoolwork . Dedicated cards These are separate expansion cards (e.g. graphics card or sound card ) to connect to the motherboard 's PCIe slots . They usually have their own processor and memory (e.g. GPU & VRAM for graphics ). Much more powerful , ideal for gaming , video editing , 3D design or professional audio . Uses more power and costs more . KS3 Home

  • 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 ➡

  • 2.4d - Image Storage - OCR GCSE (J277 Spec) | CSNewbs

    Learn about how images are represented in a computer system, including file size, resolution, colour depth and metadata. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 2.4d: Image Storage Exam Board: OCR Specification: J277 Watch on YouTube : Pixels & Resolution Colour Depth & Metadata Image File Size Bitmap Images Bitmap images are made of pixels - single-colour squares - arranged on a grid . Each pixel is assigned a binary value which represents the colour of that pixel. The quality of a bitmap image depends on the total amount of pixels , this is known at the image resolution . Because it is made of pixels, scaling a bitmap image up will result in a visible loss of quality . Most images on computers are bitmaps, such as photos and screenshots . How to Calculate the File Size of a Bitmap File Size = Resolution x Colour Depth The resolution of an image is the width in pixels multiplied by the height in pixels. The colour depth (also known as bit depth ) is the number of bits that are used to represent each pixel's colour . 1 bit represents 2 colours (0 or 1 / black or white). 2 bits will allow for 4 colours, 3 bits for 8 colours, 4 for 16 etc. A colour depth of 1 byte (8 bits ) allows for 256 different colours . Remember you must multiply the colour depth , not the number of available colours (e.g. 8 not 256). The RGB (Red , Green , Blue ) colour model uses 3 bytes (a byte of 256 red shades , a byte of 256 green shades and a byte of 256 blue shades ) that together can represent 16.7 million different colours. Example Height = 6 bits Resolution = height x width Resolution = 8 x 6 = 48 bits -------------------------- Colour Depth = 1 bit (only 2 colours) -------------------------- File Size = Resolution x Colour Depth File Size = 48 x 1 = 48 bits File Size in bytes = 48 ÷ 8 = 6 bytes File Size in kilobytes = 6 ÷ 1000 = 0.00 6 kilobytes Width = 8 bits Look carefully at the exam question to see if the examiner is expecting the answer in bits, bytes or kilobytes . Always calculate the file size in bits first then: Divide the file size in bits by 8 to convert to bytes . Divide the file size in bytes by 1000 to convert to kilobytes . Metadata for Images Metadata is additional data about a file . Common image metadata includes: Height and w idth in pixels Colour depth Resolution Geolocation Date created Last edited File type Author details Metadata is important, For example, the dimensions must be known so the image can be displayed correctly . Metadata for a picture taken on a smartphone: width in pixels, e.g. 720 height in pixels, e.g. 480 Q uesto's Q uestions 2.4d - Image Storage: 1. Describe how bitmap images use pixels . [ 2 ] 2. Define the terms image resolution and colour depth . [2 ] 3. How many colours can be represented with a colour depth of... a. 1 bit [ 1 ] b . 5 bits [ 1 ] c. 1 byte [ 1 ] 4. How is the file size of an image calculated? [2 ] 5a. An image file has a width of 10 pixels , a height of 8 pixels and a colour depth of 2 . What is the file size in bytes ? [3 ] 5b. An image file has a width of 120 pixels , a height of 120 pixels and a colour depth of 1 . What is the file size in kilobytes ? [3 ] 5c. An image file has a width of 32 pixels , a height of 21 pixels and a colour depth of 1 . What is the file size in bytes ? [3 ] 6. State what is meant by metadata and give three examples of metadata for a graphics file. [ 3 ] 2.4c - Character Storage Theory Topics 2.4e - Sound Storage

  • Python | 5b - Sleep | CSNewbs

    Learn how to delay processes using the sleep command in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 5b - Sleep Using Sleep To pause a program, import sleep from the time library . Type the word sleep followed by the number of seconds that you wish the program to break for in brackets . It must be a whole number . Below is an example of a program that imports the sleep command and waits for 2 seconds between printing: from time import sleep print ( "Hello!" ) sleep(2) print ( "Goodbye!" ) You can implement the sleep command within a for loop to produce an effective timer that outputs each second waited to the screen: You could also use a variable instead of a fixed value with the sleep command such as below: from time import sleep for second in range (1,11): print (second) sleep(1) from time import sleep seconds = int ( input ( "How many seconds should I sleep? " )) print ( "Going to sleep..." ) sleep(seconds) print ( "Waking up!" ) Sleep Task ( Slow Calculator) Create a slow calculator program that needs time to think in between calculations. Print a message to greet the user , then wait 3 seconds and ask them to enter a number . Wait another 3 seconds and ask them to enter a second number . Wait 2 more seconds , print “Thinking…” then 2 seconds later print the total of the two numbers added together . Example solution: ⬅ 5a - Rando m 5c - Date & Time ➡

  • 3.5 - Data Analysis Tools | Unit 2 | OCR Cambridge Technicals | CSNewbs

    Learn about different types of tools used in the data analysis process including data visualisation, data cleaning and GIS. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification for Unit 2 (Global Information). 3.5 - Data Analysis Tools Exam Board: OCR Specification: 2016 - Unit 2 The fifth stage of data analysis is to select the most appropriate tools to analyse the collected data. The method(s) selected will depend on the type of project and the established objectives. Data Tables Databases are often split into tables to be easier to update , view and manipulate . For example, a supermarket database may include a table of product information, another table of suppliers and another for actual stock levels. Separating the data into tables allows for simpler editing and also allows for the display of basic patterns . For example, looking at a table of stock levels in a supermarket can quickly show which products need to be ordered in as they are close to selling out. Data tables allow for the most simple form of pattern discovery and are a good method of speedy, short-term data analysis . However they present data in its current format and cannot show change or trends over time - a product may have a high stock level because it is popular and has just been ordered in, rather than because no-one is buying it. A simplified data table for a supermarket. Visualisation of Data Visualising data (by producing a chart or graph of collected data for example) makes it easier for an audience to see trends and patterns . Visualising data, like the bar chart to the right of the supermarket table from the tool above, makes it easier to understand and quicker to interpret . In this example, It is easier to see using the chart that steak pies are low in stock and should be re-ordered soon. A bar chart of the supermarket data table. Trend & Pattern Identification This tool links heavily to visualisation of data in allowing trends and patterns to be viewed as a visual format - such as producing a line graph of last year’s stock sales. Statistical analysis allows data analysts to examine numerical data and, if done correctly, can highlight relationships between different data elements - such as the price of a product and how many have been sold. Discovering links between variables is known as regression analysis . Data Cleaning Data cleaning ensures that any stored data is up-to-date and accurate , in accordance with the Data Protection Act ( 2018 ). Forms of data cleaning include removing customers who have not made a purchase in a certain amount of time (e.g. two years) and periodically checking that user addresses are up to date. Data cleaning would reduce the size of any data table by removing redundant, incorrect or unnecessary data . This would make it easier to work with the data table and would improve the data quality by removing erroneous and irrelevant data. GIS / Location Mapping Geographic Information Systems (GIS ) can be used to add geographic data to any analysis. For example, an organisation can track the geographical location of items or staff e.g. tracking the movement of shipping containers around the world to see production flow. This also works for courier services to see delays and delivery times in real-time . Q uesto's Q uestions 3.5 - Data Analysis Tools: 1. Describe how Fresh Food UK, from the question in 3.4 , could use each of the data analysis tools when trying to determine and present the most profitable stores across the country in the past year . a. Data Tables [3 ] b. Visualisation of Data [3 ] c. Trend & Pattern Identification [3 ] d. Data Cleaning [3 ] e. GIS / Location Mapping [3 ] 3.4 - Stages of Data Analysis Topic List 3.6 - Information Systems

  • 2.4c - Character Storage - OCR GCSE (J277 Spec) | CSNewbs

    Learn about the main character sets - ASCII (American Standard Code for Information Interchange) and Unicode. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 2.4c: Character Storage Exam Board: OCR Specification: J277 Watch on YouTube : Character Sets ASCII Unicode Text File Size What is a Character Set? A character set is a table that matches together a character and a binary value . Each character in a character set has a unique binary number matched with it . Character sets are necessary as they allow computers to exchange data and humans to input characters . Two common character sets are ASCII and Unicode : H = 01001000 ASCII Unicode ASCII (American Standard Code for Information Interchange ) is a common character set which does not take up much memory space . It is important to understand that the number of characters that can be stored is limited by the bits available - ASCII uses 1 byte (8 bits ) which only gives 256 possible characters . This is enough for the English language but it can’t be used for other languages or all punctuation symbols. Unicode is a more popular character set because it uses 2 bytes (16 bits ) that allow for 65,536 possible characters . The extra byte allows many different languages to be represented , as well as thousands of symbols and emojis . However Unicode requires more memory to store each character than ASCII as it uses an extra byte . Character sets are logically ordered . For example, the binary code for A is 01000001 , B is 01000010 and C is 01000011 as the code increases by 1 with each character. The file size of a text file is calculated as shown below: bits per character x number of characters Example: A small text file uses the ASCII character set (which uses 8 bits per character ). There are 300 characters in the file . 300 x 8 = 2,400 bits This could be simplified as 300 bytes or 0.3 kilobytes . File Size of Text Files 01101010 = 256 possible characters 8 bits (1 byte) 1000101101001111 = 65,536 possible characters 16 bits (2 bytes) Q uesto's Q uestions 2.4c - Character Storage: 1. What is a character set and why are they needed ? [ 2 ] 2. Describe 3 differences between ASCII and Unicode . [6 ] 3. The binary code for the character P in ASCII is 01010000 . State what the binary code for the character S would be. [1 ] 4a. A text file uses the ASCII character set and contains 400 characters . What would the file size be in kilobytes ? [ 2 ] 4b. A text file uses the Unicode character set and contains 150 characters . What would the file size be in kilobytes ? [ 2 ] 2.4b - Binary Addition & Shifts Theory Topics 2.4d - Image Storage

  • Python | Extended Task 3 | CSNewbs

    Test your ability to create a more complex program in Python based on a given scenario. Perfect for students learning GCSE Computer Science in UK schools. Extended Task 3 Hi, Susanna here, I want to make a blackjack-like program that I can play for fun at home in between revising for Computer Science. The aim of my blackjack game is to get as close to 21 as possible with the most number of cards, without going over. So... The user can choose whether to be hit with a new card (a number between 1 and 8) or fold and stop. Each number they are dealt adds up to their total . If the total goes over 21, then they lose . If they bust (when over 21) or folded then their final number and their number of cards is displayed . Blackjack For this task, you will need to create a document and include the following sections (with screenshots where appropriate): An introduction to explain the Purpose of your program . A List of Requirements for a successful program. Screenshots of your code (with comments in your code to show understanding). Testing – Create a plan to show how you will test your program and then explanations of any errors that you found and how they were fixed . An Evaluation of what worked, what didn’t, and how you met each of your requirements from your original list. Also, discuss further improvements that you could have made to improve your program. Example solution: Helpful reminders for this task: Think about the type of loop that you need. Will you need more than one loop? What variables will you need? Remember to use an input . What will you ask the user? How will you use their response? Remember to use ‘import random’ and randint to create a random number . What outputs do you need and when? What should you display… After each hand? At the beginning? At the end? ⬅ Extended Task 2 (Lottery) Extended Task 4 (Vet Surgery) ➡

  • 2.2 - Information Classification | Unit 2 | OCR Cambridge Technicals | CSNewbs

    Learn about how information can be classified into groups including private, public, sensitive and confidential. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification for Unit 2 (Global Information). 2.2 - Information Classification Exam Board: OCR Specification: 2016 - Unit 2 Information can be classified into different groups . Some data may fall into more than one classification. Sensitive Information Description: Information that should be protected from being publicly released as it could harm the safety or privacy of an organisation or an individual . Examples: Medical data that could be embarrassing to an individual if released. Financial data that will negatively impact the company if made public to competitors. Non-Sensitive Information Description: Information that can be released publicly with no fear of negative consequence . Examples: Store information including shop addresses , opening hours and the names of senior managers. Product information including prices , online reviews and general availability . Private Information Description: Private information relates to an individual and it should not be shared with anyone else without the data subject's permission . Private information is protected by the Data Protection Act and would need to be stored securely so it cannot be accessed without authorisation. Examples: Home addresses, contact information, birth dates and banking details . Employee data such as linked bank accounts and addresses. Public Information Description: Released to the public and can therefore be seen by anyone . Public information is non-sensitive . Examples: Social media usernames, posts and shared images. Public business information including addresses, promotional material and opening times. A government report like the national census every ten years. Personal Information Description: Identifiable data about a specific individual . Examples: Full name , date of birth , gender , marital status, medical history, sexual orientation and voting history. Business Information Description: Any kind of data about a specific business. This information could be public or private. Examples: Address of its headquarters Financial data or employee details. Annual sales figures . Confidential Information Description: Private data that is more restricted than sensitive information , with access limited to only those who need to know. Examples: Doctor / therapist notes Business Profits and losses Trade secrets Classified Information Description: Highly sensitive information stored by a government institution , requiring the highest levels of restricted access . Access is usually restricted by law and only viewable by authorised individuals or groups. In the UK there are three levels of classified information: OFFICIAL , SECRET and TOP SECRET . Examples: Military data Terrorism precautions Crime scene reports Anonymised Information Description: Anonymisation removes personally identifiable data from information so that an individual cannot be identified . This allows the information to be used in much wider context without running the risk of legal action. Examples: Partially anonymised information - where some of the personal information has been removed and replaced by a symbol . Completely anonymised information - where all identifiable data has been removed . Bank details are often partially or completely anonymised. A partially anonymised credit card number might be listed as: **** - **** - **** - 7427 Problems with anonymising data include: If sensitive data is not anonymised enough and the person can be identified . Useful information could be lost if too much data is anonymised . The public could lose trust in an organisation if data is insufficiently anonymised . Q uesto's Q uestions 2.2 - Information Classification: 1. Describe each type of information classification and give at least two examples : a. Sensitive information [3 ] b. Non-Sensitive information [3 ] c. Private information [3 ] d. Public information [3 ] e. Business information [3 ] f. Confidential information [3 ] g. Classified information [3 ] h. Anonymised information (partial and complete) [6 ] 2. State which classification(s) the following pieces of information would be categorised as. It might fit into more than one category. a. Shop opening times [1 ] b. Medical history [1 ] c. Twitter username [1 ] d. Crime scene report [1 ] 3. Describe three problems that organisations should consider when anonymising data . [6 ] 2.1 - Information Styles 2.3 - Quality of Information Topic List

  • OCR CTech IT | Unit 1 | 2.5 & 4.2 - Communication Methods | CSNewbs

    Learn about the different methods of communication using physical and digital ways of transferring data. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 2.5 & 4.2: Communication Methods Exam Board: OCR Specification: 2016 - Unit 1 Sections 2.5 and 4.2 are very similar so both are mixed within this page. There are many ways that employees of a business can communicate between staff members or with their customers . Text-based Communication Letter ✓ It is a traditional method of communication that can be used for formal occasions such as job offers or resignations . ✓ It can be kept and stored for physical evidence - e.g. keeping an applicant's CV in case an opportunity arises in the future. X Requires postage costs to be sent in the mail (a first-class stamp is now £1.65 ). Overseas delivery is even more expensive . X Takes several days time to be received in the post and may be lost . X A letter can't include certain formats like video. Text Message (SMS) ✓ Can reach a large audience at once with one batch message . ✓ Good for short messages - e.g. appointment reminders or confirmation codes for two-factor authentication . ✓ Doesn't require an internet connection to receive messages. X Limited to short messages (160 characters ) with no multimedia . X Text messages can cost to send each message. SMS stands for Short Message Service . Email ✓ Easily send information to many people at once, instantly . ✓ Can include documents , multimedia attachments and links . ✓ Can send targeted emails to customers on a mailing list with new products or sales promotions . X Important messages may be lost in the spam folder. X Phishing scams can spread malware via email attachments. Instant Messaging ✓ Works in real-time - messages are sent and received instantly . ✓ Attachments and hyperlinks can be sent. ✓ Can be used by support staff to help customers in real-time. X Quick speed means it's less suitable for formal conversations like interviews. X Internet access issues will disrupt any conversations . Voice-based Communication Cellular ✓ Can hear how something is said , unlike text responses. ✓ Fastest method of communication - also allows reactive conversations that can quickly change based on previous responses. X Impacted by cellular reception - won't work in remote areas / underground. X Can't see the other person's body language, presentation or facial expressions. Teleconferences ✓ Allows for groups of people to communicate at once . ✓ Businesses can use teleconferencing to communicate between offices / individuals across the world . X The quality of the call may be affected by a group's poor reception . X Because a group is communicating, people may speak over each other , especially if there is a time delay . VoIP (Voice over Internet Protocol) ✓ Allows a user to make calls over the internet (e.g. using WhatsApp). ✓ Cheaper (can also be free) to make calls rather than using a cellular network . X Relies on a good-quality internet connection . X Can potentially be less secure than cellular connections. hi there Personal Assistants ✓ Speeds up processes by making appointments, checking information or connecting to smart devices. ✓ Voice-activated - can be used whilst otherwise busy , such as typing, cooking or driving. ✓ The language can be changed to suit people's preferences. X Huge privacy concerns as companies store audio data for voice recognition and track all commands made to the device. X There may be recognition issues as sometimes the assistant doesn't understand a command . Online Communication Video Conferences ✓ Users can connect to the call (e.g. using Zoom, Skype, or Google Meet) remotely , saving time and money instead of all travelling to one location. ✓ Can be used for interviews as it allows the applicant and the interviewers to see each other and look for body language . ✓ Users can share information visually , such as designs. X A high-bandwidth connection is required to send and receive video data reliably . X A poor internet connection (e.g. a weak WiFi signal ) will result in low-quality video that may stutter or drop out , making it hard to communicate clearly . Social Media ✓ Businesses can quickly share information with a large online audience , including new potential customers . ✓ Posts can be in d i fferent formats such as text, images, videos or links to other websites. ✓ Direct messages sent on social media may be seen and responded to faster than alternatives like using email if push notifications are enabled on a phone. ✓ Some social media sites like Facebook allow for private , invite-only groups to communicate with like-minded users in a secure way. X Businesses must be cautious about what they post so as not to accidentally offend others and damage their reputation . X Social media posts and customer comments must be carefully managed , so a social media manager should be hired. Blog / Vlog ✓ Share information with followers in text , images and video formats . ✓ Blogs and vlogs can unite people with similar interests , such as a cookery blog or travel vlog. ✓ Companies can use a blog to promote new products and provide details of upcoming events to try and attract new customers . X Takes a lot of effort and time to create posts, especially editing videos for vlogs. X Bad behaviour or language in vlogs can bring punishment. Several YouTubers have lost their reputations following videos they have posted. Q uesto's Q uestions 2.5 & 4.2 - Communication Methods: 1. Describe three advantages and three disadvantages for each type of communication method . You will need to think of or research some more than the examples listed on this page. a. Letter b. SMS (Text Message) c. Email d. Instant Message e. Cellular Call f. Teleconference g. VoIP Call h. Personal Assistant i. Video Conference j. Social Media k. Blog / Vlog [6 each ] 2. Explain what VoIP stands for and what it allows a user to do. [ 2 ] 3. Describe which communication method would be most appropriate for the following scenarios and why : a. Informing your boss you are going to resign. b. Communicating with management about raising your pay. c. Chatting to team members about when the Christmas party is. d. Sending promotions to thousands of customers. e. Interviewing a potential new employee who is in a different country. f. Talking with a group of investors about the company's latest data. [2 each ] 2.6 - Software Troubleshooting 2.4 Operating Systems 4.1 Communication Skills 4.3 - Personal Attributes Topic List

  • 2.3 - Quality of Information | Unit 2 | OCR Cambridge Technicals | CSNewbs

    Learn about the characteristics of information and the impacts of both good and poor quality information on customers and stakeholders. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification for Unit 2 (Global Information). 2.3 - Quality of Information Exam Board: OCR Specification: 2016 - Unit 2 Information Characteristics Valid Information This is correct, up-to-date and complete information that fits its purpose . For example, detailed end-of-year financial data in the form of graphs. Biased Information This is technically correct, but slanted , information that presents a one-sided view . For example, end-of year financial data that focuses on profits and ignores significant losses. Relevant Information Information should be appropriate for the required purpose . Irrelevant information may get in the way of correct decision making. Accurate Information Information should be carefully selected and entirely correct , inaccurate information can lead to unwanted consequences such as higher costs and missed deadlines. Reliable Information Information from a source that can be verified and confirmed to be correct . For example, BBC News is a more reliable information source than social media posts. Information Quality The quality of information that an organisation uses will have a significant impact on further processes and decisions. Good quality information that is accurate , valid or reliable can lead to better strategic decisions , meeting deadlines and innovation . Poor quality information that is biased , inaccurate or out of date may lead to negative consequences such as loss of customer trust , fines and legal challenges . Positive Effects of Good Quality Information Reliable information received by the management team . Good quality research information. Good quality sales information. Accurate cost projection information. Informed decisions with a higher chance of success . Can lead to innovation and better understanding . Strategic decisions and planning ahead . Projects will stay within their budget . Accurate time expectations . Projects will be completed on time . Negative Effects of Poor Quality Information Biased survey with inaccurate results . Inaccurate stock information. Out of date information received by management . Inaccurate data has led to poor reviews online . Inaccurate time expectations . Misinformed decisions , not responding to customers needs . ??? Inaccurate delivery times , customers unhappy . Too much / little stock. Miss out on opportunities , possible fall in profits . Loss of customer trust , loss of customers and reputation . Financial issues . Projects take longer , cost more , stakeholders unhappy . Possible project failure . Q uesto's Q uestions 2.3 - Quality of Information: 1. Describe 5 characteristics of information . [10 ] 2. Explain 5 positive impacts of good quality information . [10 ] 3. Explain 5 negative impacts of poor quality information . [10 ] 2.2 - Information Classification 2.4 - Information Management Topic List

  • Searching & Sorting Algorithms - OCR GCSE (J277 Spec) | CSNewbs

    Learn about searching algorithms such as linear and binary search. Also learn about sorting algorithms such as merge, bubble and insertion sorts. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 1.3: Searching & Sorting Algorithms Exam Board: OCR Specification: J277 Watch on YouTube : Linear Search Binary Search Bubble Sort Merge Sort Insertion Sort Key features of a bubble sort: Uses an outer while loop (condition controlled ) to check no swaps have been made . Uses an inner for loop (count controlled ) to repeat through the length of the data set . Uses a flag (a Boolean value ) to track if a swap has been made and uses a temporary value to help correctly swap elements . Linear Search A linear search is the most simple search algorithm. Each data item is searched in order from the first value to the last as if they were all laid out in a line . The list does not have to be in any order before it is searched . This search is also known as a sequential search because the list is searched in a sequence from start to end. For large lists , this search is not very efficient . Binary Search A binary search is a much more efficient searching algorithm as it generally searches through fewer data and is often much quicker - especially for large data sets . In a binary search, the middle point of the data is selected with each iteration and compared to the value being searched for . When the midpoint matches the target value , it as been found and the search can stop. ! ! However there is a prerequisite of using a binary search - the list of data must already be sorted . A prerequisite is a condition that must be satisfied before an algorithm will work correctly . Merge Sort Merge sort is a sorting algorithm based on the idea of ‘divide and conquer ’. A merge sort divides a list into half , again and again until each data item is separate . Then the items are combined in the same way as they were divided , but now in the correct order . When the individual lists are all merged together as one list again, then the data is in order and the algorithm will end . Bubble Sort This algorithm is based on the comparison of adjacent data elements . Data elements are swapped if they are not in the correct order . The algorithm will only stop when a complete iteration through the data is completed with no swaps made . A bubble sort is not suitable for large sets of data . Insertion Sort The list is logically split into sorted values (on the left) and unsorted values (on the right). Starting from the left, values from the unsorted part are checked and inserted at the correct position in the sorted part. This continues through all elements of the list until the last item is reached, and sorted. Insertion sorts are efficient for small data sets but would be slow to sort large sets , compared to alternatives such as a merge sort. Key features of a linear search: A loop is used to check the first value in a list and increment by 1 , checking each value for a match to the target . Reaching the last element of the list without finding a match means the value is not included . Key features of a binary search: A midpoint , lowpoint and highpoint are calculated . A while loop is used to repeatedly compare the midpoint to a target value . The upper half or lower half of the data is ignored if the midpoint does not equal the target . Key features of a merge sort: This algorithm calls itself from within the subroutine (this is known as a recursive algorithm ). It continually splits sublists into a left side and a right side until each sublist has a length of 1 . Watch on YouTube Watch on YouTube Watch on YouTube Watch on YouTube Key features of a insertion sort: Uses an outer for loop (count controlled ) to iterate through each value in the list . Uses an inner while loop (condition controlled ) to find the current value’s correct position in the sorted part of the list . An insertion sort moves ‘ backwards ’ to find the correct position of each value, by decreasing the index within the while loop. Watch on YouTube Q uesto's Q uestions 1.3 - Searching & Sorting Algorithms: Linear Search Explain step-by-step how the number 8 would be found in the following list using a linear search : 12, 5, 3, 2, 8, 19, 14, 6 [4 ] Binary Search Explain step-by-step how the number 2 would be found in the following list using a binary search : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 [6 ] Merge Sort Explain step-by-step how a merge sort would sort the following list of numbers: 4, 8, 5, 1, 3, 6, 7, 2 [6 ] Bubble Sort Explain step-by-step how a bubble sort would sort the following list of numbers: 3, 1, 6, 5, 2, 4 [6 ] Insertion Sort Explain step-by-step how an insertion sort would sort the following list of numbers: 5, 2, 6, 3, 1, 4 [6 ] 1.2 - Designing Algorithms Theory Topics 2.1 - Programming Fundamentals

© CSNewbs 2025

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