Search CSNewbs
304 results found with an empty search
- 3.7 - The Internet - Eduqas GCSE (2020 spec) | CSNewbs
Learn about internet topics including web browsers, URL structure and DNS servers. Based on the 2020 Eduqas (WJEC) GCSE specification. 3.7: The Internet Exam Board: Eduqas / WJEC Specification: 2020 + What is the internet? The internet is a global network of interconnected networks . The world wide web (WWW ) is not the same as the internet. It is a way of accessing information , using protocols such as HTTPS to view web pages . What is a web browser? A web browser is software that uses the HTTP or HTTPS protocol to access and display web pages . Popular web browsers include Google Chrome , Mozilla Firefox and Microsoft Edge . What is a URL? URL stands for Uniform Resource Locator . Web pages are accessed by typing a URL (a web address) into the address bar of a web browser . The URL is the complete address that matches an IP address where the website is stored. We use URLs because they are easier to remember than IP addresses, for example, 'twitter.com' is simpler than '199.59.149.165'. What is the structure of a URL? A URL is structured into different segments: What is a DNS Server? A DNS ( Domain Name System ) server stores a list of domain names and a list of corresponding IP addresses where the website is stored. The first thing to understand is that every web page has a domain name that is easy for humans to remember and type in (such as www.csnewbs.com ) as well as a related IP address (such as 65.14.202.32) which is a unique address for the device that the web page is stored on. The steps taken to display a web page: 1. A domain name is typed into the address bar of a browser . 2. The browser checks a local (cached) host file to check if it already holds the IP address, but if it doesn't... 3. A query is sent to the local DNS server for the corresponding IP address of the domain name . www.facebook.com 4. The local DNS server will check if it holds an IP address corresponding to that domain name. If it does it passes the IP address to your browser . 66.220.144.0 5. The browser then connects to the IP address of the server and accesses the web site . If the local DNS server does not hold the IP address then the query is passed to another DNS server at a higher level until the IP address is resolved. If the IP address is found, the address is passed on to DNS servers lower in the hierarchy until it is passed to your local DNS server and then to your browser. Q uesto's Q uestions 3.7 - The Internet: 1a. Describe the difference between the internet and the world wide web ( WWW ). [ 2 ] 1b. What is the purpose of a web browser ? [ 2 ] 1c. Why do humans use URLs instead of IP addresses? [ 1 ] 1d. Write out the following URL and label each section: https://www.skynews.co.uk/worldnews/ukstockmarket [ 6 ] 2a. What is a DNS server ? [ 2 ] 2b. Describe, using a mix of text and icons / images , how a DNS server is used to display a web page . [5 ] 2c. Describe how a DNS server searches for an IP address if it is not found on the local DNS server . [ 2 ] 3.6 - 7-Layer OSI Model Theory Topics 3.8 - Cyber Threats
- 6.2 - Utility Software - Eduqas GCSE (2020 Spec) | CSNewbs
Learn about utility software including antivirus, firewall, compression, disk partitioners, defragmenters, backup and file managers. Based on the 2020 Eduqas (WJEC) GCSE specification. 6.2: Utility Software Exam Board: Eduqas / WJEC Specification: 2020 + What is utility software? Utility software are dedicated programs used for the maintenance and organisation of a computer system. Antivirus Antivirus software is used to locate and delete viruses on a computer system. The antivirus scans each file on the computer and compares it against a database of known viruses . Files with similar features to viruses in the database are identified and deleted . Firewall A firewall manages incoming and outgoing network traffic . Each data packet is processed to check whether it should be given access to the network by examining the source and destination address . Unexpected data packets will be filtered out and not accepted to the network. Disk Defragmenter As files are edited over time they will become fragmented - this is when the file is split into parts that are stored in different locations on the hard disk drive . Files that are fragmented take longer to load and read because of the distance between the fragments of the file. Defragmentation software is used to rearrange the file on the hard disk drive so that all parts are together again in order. Defragmentation improves the speed of accessing data on the hard disk drive. Backup Software System backup copies data onto a separate storage device in case the original information is lost or corrupted . Backups should be saved regularly and stored in a different location to the rest of the data. Magnetic tape is a common backup medium. A typical backup policy is one known as 'grandfather - father - son' which uses three different backups at a time. Disk Compression Compression is the process of decreasing the size of a file . Disk compression is a utility tool that automatically compresses files when saved so that more data can be stored on the hard disk drive. When a file is to be opened, the program is automatically decompressed . Disk compression increases the amount of space on a hard disk drive but it takes longer to open and close files . Disk Checker This utility is used to scan a hard drive for any corrupted data . The corrupted data is deleted to speed up reading from and writing to the hard drive. More advanced disk checkers are used to scan for bad sectors . A bad sector is a permanently damaged section of the hard drive which can no longer be used and must be skipped over. Disk Formatter Disk Partition Editor This utility tool prepares a storage device such as the hard disk drive to be used by removing the current data and creating a file system . A file system manages how data is stored and accessed . Other devices like a USB stick may need to be formatted before they can be used for the first time . Within memory, partitions are segments of data that have been grouped together logically on the hard disk drive . A disk partition editor allows a user to view and modify these memory partitions . Options include creating, editing and deleting partitions. Clipboard Manager The clipboard is a temporary storage space for copied data. For example, a large amount of text can be copied and stored on the clipboard to be pasted into another document, even when the original file has been closed . The clipboard manager adds more functionality to the clipboard to allow multiple pieces of data to be copied, cut and pasted . System Profiles A system profiler displays detailed information about the applications on a computer system, as well as data about any attached hardware devices . Information is provided and updated in real-time about the performance of software and internal components such as the CPU . Data Recovery Data recovery tools allow deleted, corrupted or otherwise inaccessible data to be returned to a usable state . The data loss may have been caused by physical damage to a drive, corrupt memory partitions or accidental deletion . Most data is not permanently removed when it is deleted so data recovery software can often be used to reaccess files . Revision Control Revision control software manages previous versions of an application so that if an error occurs the program can be returned to a previous state . This is also called version control software and can be used to manage and monitor changes made to files over time. Archiver Archiving is the process of storing important data that is not currently required . It must not be deleted but it shouldn't take up valuable storage space either. An archiver compresses multiple files using lossless compression into one folder . This archived folder can be stored on a computer system or transferred to a storage device and won't take up much space . Cryptographic Utilities A cryptographic utility is used to encrypt data so that it cannot be understood if intercepted . Encryption is commonly for data in transit - being sent between devices . Cryptographic software can also encrypt data at rest - when stored on a hard disk drive for example - so that hackers would be unable to use the data . File Manager This utility tool provides an interface to the user for accessing, editing and moving files and folders on the system. Programs will be displayed in a hierarchical ( ordered ) structure with icons representing the application logo or file type. Files can be ordered in alphabetical, chronological or other orders and the manager provides an abstracted visualisation of where the data is stored. Q uesto's Q uestions 6.2 - Utility Software: 1. What is meant by utility software ? [1 ] 2. Describe each type of utility software : a. Antivirus b . Firewall c . Disk Defragmenter d . Backup Software e . Disk Compression f . Disk Checker g . Disk Formatter h . Disk Partition Editor i . Clipboard Manager j . System Profiles k . Data Recovery l . Revision Control m . Archiver n . Cryptographic Utilities o . File Manager [2 ] 6.1 - Operating Systems Theory Topics 7.1 - Language Levels
- 2.1 - Software Development Models | F160 | Cambridge Advanced National in Computing | AAQ
Learn about the characteristics, diagrammatic representations, advantages, disadvantages, and suitability of software development models. These include the waterfall, rapid throwaway, incremental, evolutionary, rapid application development (RAD), spiral and agile models. Resources based on Unit F160 (Fundamentals of Application Development) for the OCR Cambridge Advanced National in Computing (H029 / H129) AAQ (Alternative Academic Qualification). Qualification: Cambridge Advanced National in Computing (AAQ) Unit: F160: Fundamentals of Application Development Certificate: Computing: Application Development (H029 / H129) 2.1 - Software Development Models Watch on YouTube : Software Development Models Waterfall Rapid Throwaway Incremental Evolutionary Rapid Application Development Spiral Agile There are seven software development models you need to know : Traditional models: Waterfall Prototype models: Rapid Throwaway , Incremental , Evolutionary Iterative models: Rapid Application Development (RAD) , Spiral , Agile For each development model , you need to know : Its characteristics . How to represent it in a diagram . Its advantages and disadvantages . The types of development it is suitable for. Software Development Models Each development model has its own video below but you also need to know the advantages and disadvantages of using development models in general. Waterfall Model The waterfall model is a linear and structured approach where each phase is completed one at a time in order . It needs all requirements to be clearly defined at the start , with little to no changes allowed once a phase is finished . This model is best suited for projects with fixed requirements and minimal risk of change . Rapid Throwaway Prototype Model The rapid throwaway prototype model involves quickly creating temporary prototypes to explore ideas and gather user feedback before building the final system . Prototypes are discarded after they help refine requirements , and are especially useful in projects where user needs are initially unclear . This model is suitable when user interaction and efficient interface design are critical . Incremental Model The incremental model develops a system in small , manageable sections with each part being designed , built and tested individually . Functionality is added step by step until the full system is complete . This approach allows for early partial deployment and easier handling of changing requirements over time. Evolutionary Prototype Model The evolutionary prototyping model involves building an initial prototype that is continuously improved based on user feedback until it becomes the final system . Unlike throwaway prototyping, the prototype is not discarded but gradually evolves into the full product , once the user is satisfied . This model is ideal when user requirements are expected to change or develop over time . Rapid Application Development (RAD) The rapid application development ( RAD ) model focuses on quickly building software through iterative development and frequent user feedback . It uses reusable components , time-boxing and constant feedback to speed up the delivery of an effective final product . RAD is best suited for projects that need to be completed quickly and where requirements can evolve during development . Spiral Model The spiral model combines iterative development and risk management , progressing through repeated cycles of planning , risk assessment , engineering ( development and testing ) and evaluation . Each loop focuses on identifying and addressing risks early in the project. It is ideal for complex and high-risk projects where requirements may change over time . Agile Model The agile model is an iterative and flexible approach that progresses in small , usable chunks called iterations (or sprints ). It relies on frequent collaboration with stakeholders and user feedback to adapt to changing requirements . This model is ideal for dynamic projects where quick delivery and frequent updates are important. Q uesto's Q uestions 2.1 - Software Development Models: 1. Choose three development models to explain and draw a diagram for each. [6 ] 2. A large company is making the next sequel in a hugely popular video game series , FieldBattle 2043 . Justify which application development model(s) they should use (and which they shouldn't ). [5 ] 3. Describe the advantages and disadvantages of any development models you have not covered in Q1 or Q2 . [6 ] Agile development is named after the ' Agile Manifesto ' - a set of principles for software development agreed by a group of developers at a ski resort in Utah , USA in 2001 . D id Y ou K now? 1.3.3 - App. Software Types Topic List 2.2 - Phases of Development Models
- App Inventor 2 | Simple Apps | CSNewbs
App Inventor Task 1 & 2 - Basic Apps Basic Program #1 - Colour Changer This quick tutorial will teach you how to create an app that changes the background colour when you press different buttons . See the video: In Designer layout, firstly drag four buttons from the Palette tab on the left side and drop them one at a time on top of each other in the Viewer . In the Components tab, click on each button and press Rename to change the name (this makes it easier to code them later). You don't need to choose these four colours, but it is a good idea to start with these (you can change them later). You should notice that you are only changing the name of the button - not the button on the text; these are two different variables . Now to change the text on each button. Click on a button in the centre then in the Properties tab on the right scroll down to Text and change the text to a colour. When you've changed all four button texts, then you can start to code. Click on the Blocks button in the top right to start adding the code. In the Blocks tab on the left click on each button block (e.g. Red, Blue, Green and Yellow) and drag over a 'when click ' block for each colour. Blocks we put inside of the 'when click' blocks will execute whenever that button is pressed. Grab a set Screen 1 BackgroundColor from the Screen1 section in the Blocks tab and place one underneath each when click block. Then line up the correct colour from the Colors section in the Blocks tab to the relevant button. Program 1 Complete! The easiest way to run an app that you have created at home using App Inventor 2 is to download the free MIT AI2 Companion App on your smartphone from the Google Play Store . At the top of the App inventor program on your computer , click on Connect and AI Companion . This will generate a six-digit code you can type into your phone. If your school has the emulator installed, you can also use this to test your app. Ideas to Improve Your App: Use the when Screen1 BackPressed block from the Screen1 section in Blocks to turn the background colour white when the back button is pressed. The block is shown to the right; you can work out how to use it. Add more buttons for different colours. Try purple, black and orange for example. Change the BackgroundColour (in Properties ) of each button to represent the colour it says. You might need to change the TextColour too for red and blue (see the image to the right). Password Checker Basic Program #2 - Password Checker This quick tutorial will teach you how to create an app that requires a user to enter a correct password . See the video - maximise to see it clearly: Firstly you need to grab a TextBox from the Palette tab on the left and place it in the Viewer. Then drag a Button and a Label . Put them in this order: You need to change the Text for the button in the Properties tab to 'Enter Password'. Click on your text box and delete the Hint Text from the Properties tab. Click on the label and delete the Text from the Properties tab. Don't worry, the label is still there! Now time to code. Open up the Blocks layout by clicking Blocks in the top right. Drag a when Button1 click block into the centre from the Button1 section in Blocks . Drag an if then block from Control within the when Button 1 click block. Click on the blue cog button and, in the new window underneath, drag an else block within the if block. The top part will update by itself. When the button is clicked we want to see if the text in the text box matches what we want it to be. Grab an = block from Logic and connect it to the if block. Then place a TextBox1 Text block from TextBox1 in the first half and a blank " " block from Text in the second half. In the " " block write what you want the password to be. I've chosen pikachu because pikachu is cool. Grab a Set Label1 Text block from Label1 and put one next to then and another next to else. Place a " " block from Text and snap it next to both of those blocks. If the user has entered the password correctly then you want 'Correct Password' to appear. Otherwise, if they have entered anything else , you want 'Incorrect Password' to appear. Program 2 Complete! The easiest way to run an app that you have created at home using App Inventor 2 is to download the free MIT AI2 Companion App on your smartphone from the Google Play Store . At the top of the App inventor program on your computer , click on Connect and AI Companion . This will generate a six-digit code you can type into your phone. If your school has the emulator installed, you can also use this to test your app. Ideas to Improve Your App: Change the password to something different. If the correct password is entered change the background to gree n . If an incorrect password is entered change the background to red . You may want to scroll up to the first program as a reminder. KS3 Home Task 3
- 4.1 - Boolean Logic - OCR GCSE (J277 Spec) | CSNewbs
Learn about the three logical operators - NOT, AND and OR - as well as truth tables. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 4.1: Boolean Logic Exam Board: OCR Specification: J277 Watch on YouTube : Boolean Operators & Truth Tables Logic Gate Diagrams What is a logical operator? Inside of each computer system are millions of transistors . These are tiny switches that can either be turned on (represented in binary by the number 1 ) or turned off (represented by 0 ). Logical operators are symbols used to represent circuits of transistors within a computer. The three most common operators are: NOT AND OR What is a truth table? Truth tables are used to show all possible inputs and the associated output for each input . The input and output values in a truth table must be a Boolean value - usually 0 or 1 but occasionally True or False. NOT AND OR A NOT logical operator will produce an output which is the opposite of the input . NOT is also known as Negation . The symbol for NOT is ¬ An AND logical operator will output 1 only if both inputs are also 1 . AND is also known as Conjunction . The symbol for AND is ∧ An OR logical operator will output 1 if either input is 1 . OR is also known as Disjunction . The symbol for OR is ∨ NOT Logic Gate AND Logic Gate Symbol OR Logic Gate Symbol Truth Table Truth Table Truth Table Multiple Operators Exam questions could ask you complete truth tables that use more than one logical operator . Work out each column in turn from left to right and look carefully at which preceding column you need to use. NOT B A AND NOT B A OR (A AND NOT B) As binary is a base-2 number system , the number of rows required in a truth table will double with each new input in the expression in order to show the unique combinations of inputs. The examples above use just two inputs (A + B) so 4 rows are required. e.g. A = 2 rows / A + B = 4 rows / A, B + C = 8 rows / A, B, C + D = 16 rows Logic Diagrams You may be asked in an exam to d raw a logic diagram when given a logical expression . Draw any NOT symbols or expressions in brackets first. A logic diagram for C = ¬A ∧ B A logic diagram for D = C ∨ (A ∧ B) Q uesto's Q uestions 4.1 - Boolean Logic: 1. Copy and complete the following truth tables: 1b. Simplify the expression in the second truth table. 2a. A cinema uses a computer system to monitor how many seats have been allocated for upcoming movies. If both the premium seats and the standard seats are sold out then the system will display a message. State the type of logical operator in this example. 2b. For the more popular movies, the cinema's computer system will also display a message if either the premium seats or the standard seats have exclusively been sold out. However, it will not output a message when both have been sold out. State the type of logical operator in this example. 3. Draw a logic diagram for C = (¬B v A) ∧ A . 3.2 - Testing Theory Topics 5.1 - Languages & Translators
- Key Stage 3 Python | Calculations | CSNewbs
The fourth part of a quick guide to the basics of Python aimed at Key Stage 3 students. Learn about calculations and simple mathematical operators. Python - #4 - Calculations 1. Creating Calculations To add in Python use + To subtract in Python use - To multiply in Python use * To divide in Python use / Task 1 - Create a new Python program and save the file as 4-Calculations.py Print 4 different calculations - use each operator once.(add/subtract/multiply/divide) Python is very clever, so don't be afraid to make your own calculations using larger numbers and more than one operator . 2. Using Inputs and Calculations You can ask the user to enter numbers by writing input lines. Python can then perform calculations using the numbers that the user has entered. Don't forget to add int ( and double close brackets when using numbers ! Task 2 - Copy the new code from the picture. Change the text and num1 so you are dividing by 5 not 3. Don't delete your earlier code , just add this underneath. I have cropped the images to make the new code clearer. 3. Using Calculations in a Sentence When we have printed the calculations so far, they have not been very informative! You can print calculations together with sentences so that they mean more. Use a comma ( , ) between calculations and sentences . Task 3 - Use the pictures to help you add commas and sentences to your program to be more informative. Challenge Programs Use everything that you have learned on this page to help you create these programs... Challenge Task 1 - Multiplication Create a new Python program. Save it as ' 4 -Multiplication.py ' Add a comment at the top with your name and the date. Write an input line ( don't forget int ! ) that asks the user to enter number 1. Write an input line ( don't forget int ! ) that asks the user to enter number 2. Multiply number 1 and number 2 together and print the answer. BONUS : Try to show number 1 and number 2 in the print statement (see practice task 3 to help you). Remember: Break up variables in a print line by using commas. When you run it, it could look something like this: Challenge Task 2 - Retirement Create a new Python program. Save is as ' 4-Retirement.py ' Add a comment at the top with your name and the date. Write an input line ( don't forget int ! ) that asks the user to enter their age. Print the year that they will turn 65. (This is slightly tricky. Hint : You need to know their age, and you need to know the current year. You need to subtract something, and you need to add something. Try using scrap paper to help you figure it out.) BONUS : Use only one print line. BONUS : Try to use only two lines in total . Remember: Break up variables in a print line by using commas. When you run it, it could look something like this: <<< #3 Inputs #5 Selection >>>
- Python | 9a - String Handling | CSNewbs
Learn how to handle strings (text) in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 9a - String Handling What is String Handling? String handling refers to the manipulation of a string variable , typical uses include: Checking the length of a variable. Searching a variable for a certain phrase. Checking the number of times a specific character or word is used . String handling is used to examine passwords and to ensure that they are of an acceptable strength (e.g. by checking that they are at least 8 characters in length and include a mixture of capital letters , lowercase letters and symbols ). Password: arsenal Password: $tr0nG_pA$$w0rd Lowercase & Uppercase .lower() and .upper() are functions that convert a string into a fully lowercase or uppercase version. dogbreed = "Chihuahua" print (dogbreed.upper()) CHIHUAHUA character = "sPoNgeBoB" print (character.lower()) spongebob You may have realised that Python is very specific . 'yes ', 'Yes ' and 'YES ' are all treated as different values . Converting user input into one case , such as lowercase, and then comparing that input is a better way of checking an input than having an if statement with multiple or comparisons. The program below converts the user input into lowercase to compare. 'yes', 'Yes' and 'YES' are all converted to 'yes'. answer = input ( "Would you like water? " ) answer = answer.lower() if answer == "yes" : print ( "I'll fetch you a glass." ) else : print ( "Don't dehydrate!" ) Would you like water? yes I'll fetch you a glass. Would you like water? Yes I'll fetch you a glass. Would you like water? YES I'll fetch you a glass. Practice Task 1 Ask the user to enter their first name and surname. Print their surname in uppercase followed by their first name in lowercase. Example solution: Enter First Name: Jayden Enter Surname: Hargrove Welcome HARGROVE, jayden Count Characters The easiest way to count how many times a certain value appears within a string is to use the .count() command. It is important to note that, just like when using an input statement or calculation line, you must save the calculation into a variable . An example, for counting the number of e’s in a sentence, is below: sentence = input ( "Enter your sentence: " ) e_count = sentence.count( "e" ) print ( "There were" , e_count, "e's in your sentence!" ) Enter your sentence: even ellie eats elderberries There were 9 e's in your sentence! Practice Task 2 Create a program that counts how many instances of the letter a have been entered in a sentence. Bonus: Use the .lower() function in your code to include capital letters. Example solution: Enter a sentence: An angry aardvark named Aaron. That sentence had 8 a's. Finding the Length of a String Just like when we wanted to find the length of a list, we use the len command to see how many characters are in a string . It is sensible to save the result of the function into a variable so it can be used later . fruit = input ( "Enter a fruit: " ) length = len (fruit) print ( "That fruit was" , length, "characters." ) Enter a fruit: pineapple That fruit was 9 characters. A common reason for finding the length is as part of validation , for example, checking a password is more than 8 characters : password = input ( "Enter a new password: " ) length = len (password) if length >= 8: print ( "Password accepted!" ) else : print ( "Password is too short, must be at least 8 characters." ) Enter a password: snake54 Password is too short, must be at least 8 characters. Enter a password: pebblesthedog76 Password accepted! Practice Task 3 Create a program that asks for a name. Check that the name is between 4 and 10 characters. Print appropriate messages if it is within this range and if it isn't. Example solution: Enter a name: Tom That name is too short, it must be between 4 and 10 characters. Checking the Start / End of a String To determine if the first character in a string is a specific value use the .startswith() command. .startswith() is a function that will return True or False . Below is an example program to check if a name begins with the letter L . name = input ( "Enter a name: " ) if name.startswith( "L" ) == True : print ( "I like that name." ) else : print ( "I don't like that name." ) Enter a name: Lionel I like that name. Enter a name: Katjaa I don't like that name. Similarly, you can use .endswith() to check the last characters of a string . Practice Task 4 Ask the user to enter a country. Print a message if it ends with 'land', 'stan' or any other ending. Use .endswith() Example solution: Enter a country: Finland You have entered a 'land' country. There are 9 in the world. Enter a country: Kyrgyzstan You have entered a 'stan' country. There are 7 in the world. Enter a country: Peru Thanks for your entry. Note: You don't need to check if it's a valid country. Reversing a String To reverse a string, you write the variable name and then use square brackets to move one character at a time backwards. The first two colons are left empty as they denote where to start and end from (which don’t need to be changed). Therefore the -1 states that it will reverse from the end to the start : Ask the user to enter a random sentence. Print the sentence in reverse. Example solution: Practice Task 5 Printing Parts of a String You may want to print just part of a string or variable using square brackets. You can also use len to work out the length and work back, if you want to display the last characters: Practice Task 6 Ask the user to input a long word. Output the middle character of the word. Example solution: Split Strings Use the .split command to split a string into separate words . An empty split command such as words.split() will split at each space . You can enter a value in the brackets to split at certain characters , such as words.split(",") Use the len function to count the number of words once they have been split. You can use a for loop to cycle through each word. The program below checks the length of each word . Practice Task 7 Ask the user to input a sentence. Calculate and print the amount of words in the sentence. Calculate and print the amount of words that begin with s. Example solution: ⬅ Section 8 Practice Tasks 9b - Number Handling ➡
- 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 ➡
- 5.2 - Visual Design Considerations | F160 | Cambridge Advanced National in Computing AAQ
Learn about visual design elements of human-computer interfaces such as colours, interaction, location hierarchy, messages (help, error) and typography (style, size). Based on Unit F160 (Fundamentals of Application Development) for the OCR Cambridge Advanced National in Computing (H029 / H129) (AAQ - Alternative Academic Qualification). Qualification: Cambridge Advanced National in Computing (AAQ) Unit: F160: Fundamentals of Application Development Certificate: Computing: Application Development (H029 / H129) 5.2 - Human Computer Interface Visual Design Considerations Watch on YouTube : Visual design considerations When creating a human-computer interface , there are several visual design considerations that the development team must take into account, such as the use of colour and the style of typography . You need to know how each visual design consideration is used when designing human-computer interfaces and how these interfaces can be improved to be more effective . As with most topics, it is also vital to consider how client requirements may impact changes related to visual design , for example, using larger text for users with visual impairments . Visual Design Considerations Visual Design Considerations Colours are used to define the visual appearance of the interface . This includes background colours , button colours , icons and text . Interaction refers to how users control or respond to the system through input methods like clicking , tapping , swiping , typing or speaking . Location hierarchy is about the placement and organisation of interface elements based on importance . Messages are displayed to provide feedback , guidance or explanations - such as confirming actions , explaining errors or offering help . Typography includes the choice of font types and the size , spacing , weight (boldness) and alignment of text . Q uesto's Q uestions 5.2 - Human-Computer Interface Visual Design Considerations: 1. Explain how colours can be used effectively in human-computer interfaces . [4 ] 2. Describe what is meant by location hierarchy and why it is important to consider . [4 ] 3. Suggest specific visual design considerations an application developer should consider when making software for a primary school in Dubai . [ 5 ] Approximately 1 in 12 men and 1 in 200 women are colour-blind , meaning good designers should include text or icons rather than relying on just colour to convey meaning . D id Y ou K now? 5.1.2 - Types of Devices Topic List 5.3 - HCI Designs & Diagrams
- 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
- 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 | 3.1 - Server Types | CSNewbs
Learn about the role of different server types including file, application, print, email, mail servers and the hypervisor. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 3.1 - Server Types Exam Board: OCR Specification: 2016 - Unit 1 What is a server? A server is a powerful dedicated system on a network . It requires increased memory , storage and processing power than traditional computer systems to fulfill its role across the network. Servers need to be scalable - this means they must be adaptable and able to efficiently manage the needs of connected systems if more are added or some are removed . Servers have different roles so a company may use multiple , separate server types within their organisation, each with a specific purpose . Having separate servers is costly but beneficial as if one loses connection , others may still be usable . Also a server will be more efficient if it is only managing one resource (e.g. printers) at a time . File Server A file server centrally stores and manages files so that other systems on the network can access them. The server provides access security , ensuring that only users of the appropriate access level can access files. File servers can be used to automatically backup files , as per the organisation's disaster recovery policy. Using a file server frees up physical storage space within a business and can provide printing services too. Printer Server These servers control any printers on a network and manage printing requests by sending the document to an appropriate printer. Print servers use spooling to queue print jobs so that they are printed when the printer is ready. If a fault occurs with a certain printer, work can be automatically diverted to another available printer. Application Server These servers allow users to access shared applications on a network. All users will be able to access common applications like email software or word processing, but the server will also restrict certain applications to those with invalid access levels (such as hiding financial databases from employees outside of the finance department). Application updates can be simply deployed to the application server only , avoiding individual updates for each system and saving a lot of time . Installers can be hosted on an application server, allowing the software to be easily installed on other connected machines . Database Server These servers manage database software that users on the network can access and use to manipulate data . Data held on the server will be stored in a database accessible from multiple connected computers . The data can be modified using query languages such as SQL. Storing data on a database server, rather than individual computers, is more reliable . A database server for a business also allows for scaling - for example, the database can be increased in size if the customer base grows. Web Server A web server manages HTTP requests from connected devices to display web pages on web browsers . A request (e.g. csnewbs.com) is sent to the web server. The server contains a list of known URLs and their matching IP addresses . The server contacts the server where the web page is held and delivers the web page to the client . Mail Server These servers send and receive emails using email protocols (SMTP & POP) allowing email communication between other mail servers on other networks. The server makes sure emails are delivered to the correct user on the network. Email servers can store company address books making internal communication easier for organisations. The server may have anti-spam functions to reduce junk mail. Hypervisor A hypervisor allows a host machine to operate virtual machines as guest systems. The virtual machines share the resources of the host , including its memory, processing power and storage space. This type of technology is called virtualisation . The guest machines are isolated so if one failed, the other guests and the hosts are not affected - demonstrating good security . The hypervisor optimises the hardware of the host server to allow the virtual machines to run as efficiently as possible. Q uesto's Q uestions 3.1 - Server Types: 1a. What is a server ? Why does it need to be scalable ? [2 ] 1b. Give two reasons why a company may use multiple , separate servers . [2 ] 1c. State the 7 types of server . [1 each ] 2. A medium-sized animation company working on a movie are considering buying a server. Describe each type of server and the different roles they have. a. File Server b. Printer Server c. Application Server d. Database Server e. Web Server f. Mail Server g. Hypervisor [4 each ] 3. What type of technology does a hypervisor use to control multiple virtual machines? [1 ] 2.7 - Protocols Topic List 3.2 - Virtualisation








