Search CSNewbs
304 results found with an empty search
- 9.1 - IDE Tools - Eduqas GCSE (2020 Spec) | CSNewbs
Learn about the tools of an integrated development environment (IDE) including the editor, debugger, library, trace, memory inspector and error diagnostics. Based on the 2020 Eduqas (WJEC) GCSE specification. 9.1: IDE Tools Exam Board: Eduqas Specification: 2020 An IDE (Integrated Development Environment ) provides programmers with the following facilities (tools ) to help create programs : Editor The editor is software that allows a programmer to enter and edit source code . Editor features may include: Automatic formatting (e.g. automatic indentation). Automatic line numbering (this helps to identify exactly where an error has occurred). Automatic colour coding (e.g. Python turns loop commands orange and print commands purple). Statement completion (e.g. offering to auto-complete a command as the user is typing.) Libraries A library is a collection of commonly used functions and subprograms that can be linked to a program . For example, Python can import functions from its code library including random or time commands). Libraries must be linked to the main program using a linker . Linker Links together pre-compiled code from software libraries . For example, the import random command in Python links to the random library. Loader Pre-compiled code is loaded into RAM to be executed. Code Optimisation The code is optimised so it is fast , efficient and uses as little of the computer's resources as possible. Debugger Identifies errors in the code with the exact line of the error to help fix the problem . Break point The programmer selects a specific line and the program is paused once it reaches it. Variable values at that point are shown . Variable Watch cost Displays the current value of a selected variable . A variable can be watched line-by-line to see how the value changes . Trace Memory Inspector Logs the values of variables and outputs of the program a s the code is executed line by line . Displays the contents of a section of memory and how it is being used by the program . Error Diagnostics Displays information about an error when it occurs, such as the line it occurred on and the error type (e.g. syntax or runtime). This helps the programmer to fix the error . Specific errors can be detected such as a syntax error . See 10.3 . Compilers & Interpreters Both tools convert the source code written by a programmer into machine code to be executed by the CPU. A compiler converts the entire source code into executable machine code at once . After compilation, the program can be run again without having to recompile each time. An interpreter converts source code into machine code line by line . An interpreter must reinterpret the code each time the program is required to run . See 10.1 for both tools. Subroutines & Functions A subroutine is a section of code that can be re-used several times in the same program. There are two types of subroutines: A procedure just executes commands , such as printing something a certain number of times. A function can receive data from the main program (called a parameter ) and return a value upon completion. Subroutines (procedures and functions) are designed to be repeated and have three key benefits: Subroutines make programs easier to read and design . They reduce the duplication of code . Makes it is easier to debug a program. Q uesto's Q uestions 9.1 - IDE Tools: 1. Describe the purpose of each type of IDE facility : a. Editor b. Interpreter c. Compiler d. Linker e. Loader f. Debugger g. Break point h. Variable Watch i. Trace j. Memory Inspector k. Error Diagnostics [ 2 each ] 8.5 - Validation & Verification Theory Topics 10.1 - Translators
- Python | 8c - Dictionaries | CSNewbs
Learn how to create and use dictionaries in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 8C - Dictionaries Creating a Dictionary Dictionaries are used in Python to link items of data together . The example on this page uses a footballer dictionary which links a player with a team they played for. To define a dictionary, use curly brackets { } and separate linked data with a colon . A dictionary can be written on one line but the method below makes it easier to read: Printing Data from a Dictionary The first part of the linked data in a dictionary is called the key (e.g. each footballer in my example above). The second part of the linked data in a dictionary is called the value (e.g. each team). Example: key : value "Harry Kane" : "Tottenham Hotspur" A for loop can be used to cycle through each set of keys and values in the dictionary: Practice Task 1 a) Create a dictionary of your teachers and the subject they teach. b) Print their name and the subject they teach on each line. Example solution: Adding and Removing Data from a Dictionary Data can be added to a dictionary by stating the new key and value . You must use square brackets - [ ] The new data will be added to the end of the dictionary. You can print the whole dictionary to see any changes - e.g. print(playerdictionary) Data can be removed from a dictionary by stating the new key to remove in a pop command. You can print the whole dictionary to see any changes - e.g. print(playerdictionary) The whole dictionary can be cleared (reset to blank) using the clear command. Practice Task 2 a) Ask the user to enter a new teacher and their subject. b) Ask the user to remove a teacher. c) Print the list of teachers and check the new teacher has been added and the other one removed. Example solution: Searching Through a Dictionary An if statement can be used to check if a specific key is in a dictionary. If the key is in the dictionary then a message can be displayed using the key and the value . Otherwise, an else statement can output an appropriate response. To search for a value in a dictionary a for loop should be used to cycle through each key . If the value of each key matches the value that is being searched for then it will be printed. Practice Task 3 a) Create a search that allows a user to enter a teacher's name and prints the subject that they teach. b) Include an else statement to print a response if a teacher is not in the dictionary. Example solution: Changing Data & Copying a Dictionary The way to change values is similar to adding new data. The first input below is to determine the key and the second input determines the new value to be changed to. The copy command is used to make a duplicate of a dictionary . Practice Task 4 a) Create a copy of your teacher dictionary. b) Allow the user to enter a teacher and a new subject that they teach. c) Print the copy of the dictionary with the new values. Example solution: Using a Dictionary to Make a Game The code below is used to make a puzzle game where the user has to type in a footballer and the team they played for. I have added comments to explain the different parts of the code. A separate list has been created at the start to store the names of keys (players) that been correctly guessed . A while loop is used to constantly ask the user for players and teams. When they have guessed all 10 players (and the correct list reaches 10 ) the loop breaks and the game end. Instead of a further practice task here, Task 6 of the Section 8 Practice tasks page challenges you to make a similar game using a dictionary. ⬅ 8b - 2D Lists Section 8 Practice Tasks ➡
- Desktop Publishing | CSNewbs
An overview of what desktop publishing (DTP) is, considerations designer must take and common forms such as posters, leaflets and business cards. Desktop Publishing (DTP) What is DTP? Desktop Publishing (DTP) software allows people to create documents with a mixture of graphics and text . Examples of desktop publishing software are Microsoft Publisher and Serif PagePlus . Desktop publishers can be used to produce documents such as business cards, leaflets, brochures, newspapers, magazines and newsletters . DTP software can be cheap and printers at home are more common these days so people can design and print their own documents. Professional-looking documents can be made simply and without an extensive knowledge of graphic design. The biggest advantage of using DTP is that it is frame based . Text and picture frames can be laid out on the page, and rotated, moved or resized as necessary. It is easy to import images from clip art or the web. The view of the page is known as WYSIWYG (W hat Y ou S ee I s W hat Y ou G et) because the view on the computer will be very similar to what you get when it is printed. What to consider when using DTP Orientation Will your document be landscape or portrait ? Some document types are more commonly one orientation than the other. For example, business cards are generally landscape but newsletters are more often portrait. Size The size of a typical piece of paper is A4. But that is too large for most DTP documents. The larger the number, the smaller the piece of paper . A5 is half the size of A4 and A3 is twice the size of A4. Documents can also be measured in millimetres, for example, an appropriate business card size is 85mm wide and 55mm high. House Style A house style is a set of rules to ensure that each document made by a person or company is part of an identity . To be consistent , each document should use the same logo, titles, colours, graphics and layout . For example, the NHS always uses a blue colour, the same logo and similar layout on each of its documents. Some companies have perfected their house style so that they are synonymous with a single colour - e.g. McDonald's use yellow and Coca-Cola use red and white . DTP Documents Business Cards A business card is a small piece of card that must be simple and stylish . The purpose of a business card is to clearly state the contact details of a person or company. Sharing your business card with other people is one way to promote your business or skills to attract new business partners or customers. A business card must be uncluttered and clearly display relevant contact information, such as an email address, phone number or physical address. Today, business cards may also state social media contacts, such as Facebook pages or Twitter accounts. Flyers A flyer is a small handout that advertises an event or new product. The purpose of a flyer is to clearly and quickly promote an event . It must be eye-catching and to-the-point so that people can immediately understand what it is about. Flyers are often handed out in the street or posted through letterboxes so if it is not clear people will just ignore it. A flyer should use a large title to promote the event, as well as appropriate graphics and information about the date, location and time. It should also contain contact details including a telephone number, website and email address. Posters A poster is a large piece of paper that is put up to advertise an event and display more information than a flyer . Posters should promote an event by using large titles and graphics to clearly describe where the event is taking place, when it is and why people should go. Because there is much more space on a poster than a flyer, additional information can be added and some kind of persuasion to entice passers by to attend. Leaflets A leaflet is a small folded handout that provides more information about an event or new product. The purpose of a leaflet is to give additional details about an event . It can be used before an event to describe the different parts, such as the different acts in a circus or different bands at a festival. It can also be used during an event, such as at a school fair to list the different stalls. Because it is folded over it can display a large amount of information, with both text and graphics . The front of the leaflet should clearly display the purpose of it and the text inside must be readable with images to break up the words. There may also be contact information inside the leaflet, such as directions to a website or social media page .
- Python | 4a - If Statements | CSNewbs
Learn how to use if statements in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 4a - If Statements If Statements Selection is one of three constructs of programming , along with Sequence (logical order) and Iteration (loops). An if statement is a conditional statement that performs a specific action based on conditional values. Essentially, if thing A is true , then thing B will happen . If the user answers yes to the window question, then an appropriate statement is printed. Double equals stands for ‘is equal to ‘. The colon stands for THEN and the line after an if statement must be indented (press tab key once). answer = input ( "Is the window open? " ) if answer == "yes" : print ( "It's chilly in here!" ) Is the window open? yes It's chilly in here! But what if the window is not open? At the moment nothing will happen if you type no: Is the window open? no The elif command stands for else if . Essentially: If thing A is true then do thing B, else if thing C is true then do thing D: But what about any other answer than yes or no? The else command will submit a response if the value is anything else. The if and elif commands have a colon at the end, but else has it at the start. Also, else does not need to be on a new line. answer = input ( "Is the window open? " ) if answer == "yes" : print ( "It's chilly in here!" ) elif answer == "no" : print ( "It's quite hot in here!" ) answer = input ( "Is the window open? " ) if answer == "yes" : print ( "It's chilly in here!" ) elif answer == "no" : print ( "It's quite hot in here!" ) else : print ( "I'm not sure what you mean." ) Is the window open? no It's quite hot in here! Is the window open? banana I'm not sure what you mean. If Statements Task 1 ( Left or Right?) Use an input line to ask the user whether they want to turn left or right . Print a sentence of your choice if they chose left and a different sentence if they chose right . Include an else statement in case the user doesn't input left or right. Example solutions: There is a path ahead. Do you turn left or right? left The path turns and twists until it reaches a cliff. Dead end! There is a path ahead. Do you turn left or right? right A snake slithers across the path and bites your leg. Oh no! There is a path ahead. Do you turn left or right? backwards That's not an option! Nested If Statements Complex programs may require you to have if statements within if statements - when programming, one thing inside another is known as nesting . You must make sure that the related if , elif and else statements line up with each other . Use the tab key to indent a line. outer if inner if weather = input ( "What is the weather like today? " ) if weather == "sunny" : sunny = input ( "How hot is it? " ) if sunny == "very hot" : print ( "Take some sunglasses with you!" ) elif sunny == "cool" : print ( "Maybe take a jacket just in case?" ) else : print ( "Enjoy the sunshine!" ) elif weather == "rainy" : print ( "Take an umbrella!" ) else : print ( "Have a good day!" ) = What is the weather like today? rainy Take an umbrella! = What is the weather like today? sunny How hot is it? cool Maybe take a jacket just in case? = What is the weather like today? snowy Have a good day! = What is the weather like today? sunny How hot is it? very hot Take some sunglasses with you! If Statements Task 2 ( Nested Ifs) Use the weather program above as an example to help you write your own program with a nested if for at least one option. Be careful to have your nested if's if, elif and else statements in line with each other. Your program doesn't have to be about juice. Example solutions: Would you like orange, apple or tomato juice? orange Would you like your orange juice smooth or with bits? smooth One smooth orange juice coming up! Would you like orange, apple or tomato juice? orange Would you like your orange juice smooth or with bits? bits A pulpy orange juice is on its way! Would you like orange, apple or tomato juice? tomato Yuck, you can't be serious? Using Selection with Numbers Comparison operators such as > (greater than ) > = (greater than or equal to ) < (less than ) and < = (less than or equal to ) can be used with if statements. Logical operators such as and and or can also be used - more about them in section 4c . When comparing a variable's value to a specific number, such as 50, don't forget to use double equals ( == ) . Python Comparison Operators score = int ( input ( "Enter the maths test score: " )) if score == 50: print ( "You scored top marks!" ) elif score >= 40 and score < 50: print ( "You scored a great grade!" ) elif score >= 20 and score < 40: print ( "You did okay in the test." ) else : print ( "You have to try harder next time!" ) = Enter the maths test score: 50 You scored top marks! = Enter the maths test score: 43 You scored a great grade! = Enter the maths test score: 20 You did okay in the test. = Enter the maths test score: 13 You have to try harder next time! If Statements Task 3 ( Fastest lap) A racing video game has a challenging track that players try to get a quick lap on. The current fastest lap time is 37 seconds . Ask the player to enter their lap time and print a response based on their input . You need individual responses for the following inputs: Faster than 37 seconds. Between 37 seconds and 59 seconds. Between 60 seconds and 90 seconds. Slower than 90 seconds. Example solutions: Enter your lap time: 35 You have set a new record!!! Enter your lap time: 59 You did well this time! Enter your lap time: 83 A little bit slow this time! Enter your lap time: 110 Were you even trying!?! Hurry up! Not Equal To The opposite of equal to ( == ) is not equal to ( != ). != is often used with while loops to repeat code while an input is not what is expected , for example repeatedly asking for a password while the input is not equal to "fluffythecat123". The code below uses != for an incorrect answer (although it could easily be re-written to use == for a correct answer). answer = input ( "What is the capital of Eritrea? " ) if answer != "Asmara" : print ( "That is incorrect! It is Asmara." ) else : print ( "You got it right!" ) = What is the capital of Eritrea? Asmara You got it right! = What is the capital of Eritrea? Windhoek That is incorrect! It is Asmara. If Statements Task 4 ( True or False? ) Come up with your own true or false question that the user has to respond to. Depending on their answer , print whether they got it right or wrong . You may want to use an if statement with == for a correct answer or != for an incorrect answer , there's multiple ways to write this program. Example solutions: There are 140 million miles between Earth and Mars. TRUE or FALSE? TRUE That is correct! It is really that far! There are 140 million miles between Earth and Mars. TRUE or FALSE? FALSE You got it wrong, there really are 140 million miles between us! ⬅ Section 3 Practice Tasks 4b - Mathematical Operators ➡
- Python | 9b - Number Handling | CSNewbs
Learn how to handle numbers in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 9b - Number Handling Rounding Numbers The round() command is used to round a value to a certain number of decimal places . Type your variable into the round command brackets, add a comma and state the number of decimal places to round to. Fixed Decimal Places (Currency) The round function will remove any trailing 0s , for example 30.1032 will become 30.1 even if you specified to round to 2 decimal places . Instead, you can use an f -string and write :.2f after a bracketed variable to use exactly 2 decimal places . The number can be changed from 2. books = int ( input ( "How many books would you like to buy? " )) total = books * 3.99 print ( f"The total is £ {total:.2f} - Thanks for your order!" ) How many books would you like to buy? 10 The total is £39.90 - Thanks for your order! How many books would you like to buy? 100 The total is £399.00 - Thanks for your order! Practice Task 1 Ask the user to enter any large number. Ask the user to enter another large number. Divide the two numbers and print the answer to 3 decimal places. Example solution: Using Numbers as Strings The following techniques all require the integer to be converted into a string first using the str command. Just like a string, you can shorten a variable to only display a certain length . Remember that Python starts at zero . You can select a specific digit in the same manner as when selecting characters in a string. If you want to use your variable as an integer again later you would need to convert it from a string to an integer using the int command. Again, reversing a number is the same as reversing a string. You can also use other string handling methods such as .startswith() or .endswith() Practice Task 2 Ask the user to enter a 10 digit number. Select the 2nd and 8th digits and add them together. Print the total. Example solution: ⬅ 9a - String Handling Section 9 Practice Tasks ➡
- 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
- OCR CTech IT | Unit 1 | 5.5 - Digital Security | CSNewbs
Learn about digital methods of protecting data such as anti-malware, firewall, usernames and passwords, levels of access and encryption. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 5.5 - Digital Security Exam Board: OCR Specification: 2016 - Unit 1 ****** Usernames & Passwords Usernames must be matched with a secure password to minimise the chances of unauthorised users accessing a system. Passwords should contain a mix of uppercase and lowercase letters , punctuation and numbers . Passwords should be of a substantial length (at least 8 characters) and should be regularly changed . Digital Security Measures Firewall Firewalls (see 2.3 ) prevent unauthorised access to or from a network . Firewalls filter data packets and block anything that is identified as harmful to the computer system or network. Firewalls can also be used to block access to specific websites and programs. Encryption Encryption is the conversion of data ( plaintext ) into an unreadable format ( ciphertext ) so it cannot be understood if intercepted . Encrypted data can only be understood by an authorised system with a decryption key . Anti-Malware Anti-virus software (see 2.3 ) scans a system and removes viruses . If left to infect a system a virus could delete data or permit access to unauthorised users . Anti-spyware software removes spyware on an infected system so hackers cannot view personal data or monitor users. Organisations should install and regularly update anti-virus and anti-spyware programs. Permissions Permissions is the creation of different levels of file access so that only authorised people can access and change certain files . There are different levels of file access : No access Read-only Read/write Q uesto's Q uestions 5.5 - Digital Security: 1a. Describe why usernames and strong passwords are necessary. [2 ] 1b. State 3 rules for choosing a strong password . [3 ] 2. Describe the purpose of anti-virus and anti-spyware software. [4 ] 3. Describe the roles of a firewall . [4 ] 4. Explain what encryption is. [3 ] 5. What are permissions ? What are the 3 levels of access ? [5 ] 5.4 - Physical Security Topic List 5.6 - Data & System Disposal
- Python | 6a - For Loops | CSNewbs
Learn how to create and use for loops in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 6a - For Loops Types of Loop The third construct of programming (after Sequence and Selection) is Iteration . If you iterate something, then you repeat it. There are two key loops to use in Python: for loops and while loops . A for loop is count controlled – e.g. “For 10 seconds I will jump up and down”. The loop will continue until the count (e.g. 10 seconds) has finished . A while loop is condition controlled – e.g. “While I am not out of breath, I will jump up and down.” The loop will continue as long as the condition remains true . Simple For Loops (1 Range Value) for i in range (5): print ( "This is a loop!" ) This is a loop! This is a loop! This is a loop! This is a loop! This is a loop! for i in range (8): print ( "Jaffa Cakes aren't biscuits" ) Jaffa Cakes aren't biscuits Jaffa Cakes aren't biscuits Jaffa Cakes aren't biscuits Jaffa Cakes aren't biscuits Jaffa Cakes aren't biscuits Jaffa Cakes aren't biscuits Jaffa Cakes aren't biscuits Jaffa Cakes aren't biscuits The i is a count variable , it is used to measure each iteration (turn) of the loop. In the range brackets write the number of times to loop the indented code. Don’t forget the colon at the end and remember that everything you want to repeat must be indented (press tab key once). For Loops Task 1 (Repeat Your Name ) Example solutions (shortened): Create a simple for loop that prints your name twenty times. For Loops Task 2 (Are We There Yet? ) Christopher Christopher Christopher ... Create a simple for loop that prints the sentence 'Are we there yet?' 150 times. Are we there yet? Are we there yet? Are we there yet? ... Counting Using i (2 Range Values) For loops can be used to count by referring to the iteration inside the loop itself using i : for i in range (5): print ( "Loop number" , i) Loop number 0 Loop number 1 Loop number 2 Loop number 3 Loop number 4 for i in range (1,6): print ( "Loop number" , i) Loop number 1 Loop number 2 Loop number 3 Loop number 4 Loop number 5 There are two important things to know about how Python counts using for loops. Python will automatically start counting at 0 rather than 1. The second value in the range is an exclusive limit - it will stop 1 before this value. For example, if you wanted to count 1 to 10 you would need to write range(1,11) . For Loops Task 3 (100 to 150 ) Create a for loop that prints all numbers from 100 to 150 . You don't need to print any additional text, just the i variable. Example solution (shortened): 100 101 102 ... ... 148 149 150 Using a Step (3 Range Values) A third value can be added to the range brackets of a for loop to define a step . A step is the number to go up (or down ) with each iteration . for i in range (2,11,2): print ( i) 2 4 6 8 10 for i in range (18,0,-3): print ( i) 18 15 12 9 6 3 In most programs defining a step is not essential , Python will assume it is +1 if you don't include it. For Loops Task 4 (Even Numbers 10 to 30 ) Example solution for Task 4 (shortened): Create a for loop that prints all even numbers from 10 to 30 . Use a step . For Loops Task 5 (Countdown ) Use a for loop with a negative step to print a countdown from 10 to 1 . 10 12 14 ... ... 26 28 30 Using Variables with For Loops Variables can be used to make for loops suitable for a range of different purposes. loopnum = int ( input ( "Times to repeat: " )) for i in range (loopnum): print ( "Hello!" ) Times to repeat: 4 Hello! Hello! Hello! Hello! The loop above uses a variable in the range brackets to repeat the loop the specific number of times that the user enters . loopnum = int ( input ( "Times to repeat: " )) word = input ( "Word to repeat: " ) for i in range (loopnum): print (word ) Times to repeat: 3 Word to repeat: velociraptor velociraptor velociraptor velociraptor The loop above uses two variables that are input by the user ; one to define the range and another that is printed . For Loops Task 6 (Many Happy Birthdays ) Example solution for Task 6 (shortened): Ask the user to input their age then print 'Happy Birthday! ' that many times. For Loops Task 7 (House Number and Name ) Ask the user to enter their house number (e.g. 15 if they lived at 15 Cherry Road) and their name . Print their name as many times as their house number . For example, if Hannah lived at 103 Apple Lane then Hannah would be printed 103 times . Enter your age: 5 Happy Birthday! Happy Birthday! Happy Birthday! Happy Birthday! Happy Birthday! ⬅ Section 5 Practice Task s 6 b - While Loops ➡
- Greenfoot Tutorial | CSNewbs
A tutorial to understand how to create a game in Greenfoot. A simple step-by-step guide and walkthrough featuring all code needed for the Eduqas GCSE 2016 specification. A Tutorial to Creating a Greenfoot Game Greenfoot Home Greenfoot is software that uses the programming language Java to make simple games. This is called object-oriented programming (OOP ) because objects are coded to interact in a visual environment. Work your way through the following tutorial to create a game similar to one required in the WJEC 2017 specification Component 2 exam . Topic Links: Starting from Scratch & Populating the World Move with Arrow Keys Move Randomly & Bounce on Edge Remove Objects Play Sounds The Counter Extension Ideas Pupils using the 2017 WJEC specification will use Greenfoot version 2.4.2 , despite the fact that Greenfoot is now on version 3.9.0 . See the download page . This tutorial will work on all versions . Watch on YouTube:
- 1.3 - Access & Devices | Unit 2 | OCR Cambridge Technicals | CSNewbs
Learn about different categories of computer systems that can be used to access information including handheld, fixed and shared devices. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification for Unit 2 (Global Information). 1.3 - Access & Storage Devices Exam Board: OCR Specification: 2016 - Unit 2 Handheld Devices Examples of handheld devices: Handheld devices are small, light and possibly can be worn on the human body. These devices are very portable and easy to transport but their small size restricts the space for a powerful processor or high memory capacity. Handheld devices are becoming more powerful over time with extra features, storage options and network connectivity. Advantages: Light and portable so they can be easily carried on a person or in a pocket . Runs on battery power so do not need to be plugged into a power source (unless to charge) allowing for freedom of movement . Disadvantages: Low processing power due to small size and no cooling system . Relies on battery power which may not last for long. More likely to be lost, damaged or stolen . Generally small memory / storage capacity and low versatility . Smartphone Small Tablet eReader Smartwatch Portable Devices Examples of portable devices: Portable devices are larger and more powerful than handheld devices and can be carried easily in a bag. Laptops and larger tablets are the main examples of portable devices. Advantages: Light and portable so they can be easily transported in a laptop bag or small rucksack. Runs on battery power so they can work without a power outlet , such as to complete work on a train or in a library. More powerful and versatile than handheld devices. Disadvantages: Lower processing power and smaller memory / storage capacity than fixed devices like desktops. Reliant on their battery power which may only be a few hours. Laptop Large Tablet Fixed Devices Examples of fixed devices: Fixed devices are bulky devices that require a constant power connection . The most common example of a fixed device is a desktop computer which has a higher processing power and storage capacity than handheld and portable devices. Advantages: Desktop computers have the highest processing power of commercially available home / work computers and contain sufficient cooling systems to maintain temperature. Desktops and games consoles have large storage capacities and can be upgraded / expanded to even larger sizes. Desktop computers are very versatile and are powerful enough to be used for thousands of different purposes, from basic word processing and web browsing to server roles and data mining. Disadvantages: Reliant on a power outlet and cannot be transported whilst on. Heavy and difficult to move . May require additional components like a monitor. Typically more expensive than handheld and portable devices. Desktop Games Console Smart TV Shared Devices A shared device allows multiple users to access data at the same time . Cloud storage is the most common example of a shared device and is used by individuals, schools and businesses around the world through services such as Google Drive, Apple's iCloud and Microsoft's One Drive. A data centre is a dedicated building that contains computer systems - Facebook uses data centres across the globe so that their social media service can be available to users every second of the day. Database servers were explained in Unit 1 section 3.1 . Advantages: A ccessible by multiple users at the same time . For example, the database server can be accessed by employees of a bank simultaneously. Data centres allow online services to run all hours of the day and year . For example, Google uses data centres across the world to ensure their services can be accessed all of the time. Cloud storage frees up physical space for users as the storage is located (usually) on third-party servers. Cloud storage devices allow authorised users such as clients or staff members to access information or work remotely (outside of the office). Disadvantages: Shared devices are reliant on stable network connections . If a connection is lost, access to the device will be affected . Setting up shared devices within an organisation requires technical knowledge , especially for companies establishing their own cloud storage or data centre. Examples of shared devices: Cloud Storage Data Centre Database Server Q uesto's Q uestions 1.3 - Access & Storage Devices: 1. Identify the type of device that the following devices fit into: a. Laptop b. Cloud storage c. Desktop computer d. Smartphone [4 ] 2. Describe the advantages and disadvantages of using each of the 4 types of storage devices. a. Handheld devices [6 ] b. Portable devices [6 ] c. Fixed devices [6 ] d. Shared devices [6 ] 3. For the following scenarios explain which specific device (not type) which would be suitable. You must also justify your choice . a. Working on a spreadsheet on a train before work. [4 ] b. Taking a video of a penalty in a football match to upload to Twitter. [4 ] c. Working on a file with team members located across the country. [4 ] d. Playing Civilization VI on highest settings whilst listening to rock climbing podcasts in a separate tab. [4 ] 1.2 - Storage Media Topic List 1.4 - Internet Connections
- 10.2 - Stages of Compilation - Eduqas (2020 Spec) | CSNewbs
Learn about the six stages of compilation - lexical analysis, symbol table construction, syntax analysis, semantic analysis, code generation and code optimisation. Based on the 2020 Eduqas (WJEC) GCSE specification. 10.2: Stages of Compilation Exam Board: Eduqas Specification: 2020 A compiler translates source code (high-level language written by a programmer) into machine code in five separate stages : 1. Lexical Analysis The term 'lexical' refers to words and phrases . Source code needs to be broken down into tokens that can later be analysed. In lexical analysis: Spaces and comments are removed from the code. Identifiers , keywords and operators are replaced by tokens . A token is similar to a variable with a name and a value . A symbol table is created. T his table stores the addresses of all variables , labels and subroutines used in the program. 2. Syntax Analysis The term 'syntax' refers to sentence structure . In syntax analysis: The tokens created in the first stage are checked to see if they follow the syntax (spelling and grammar ) rules of the programming language. This process is called ' parsing ' . During parsing, if a syntax error is found then an error message is displayed and compilation stops . 3. Semantic Analysis The term 'semantic' refers to logic . Variables are checked in this stage to ensure they are used correctly: Variable checks ensure they are correctly declared and use a valid data type (for example integers are not assigned to decimal values). Operation checks ensure they are correct for the data type used ( for example dividing a number must result in an real value ). 4. Code Generation The machine code (data in a binary format ) is generated . 0010 1011 0101 0101 0110 0111 0101 0001 0101 0101 0101 0110 5. Code Optimisation The code is optimised so it is fast , efficient and uses as little of the computer's resources as possible. Q uesto's Q uestions 10.2 - Stages of Compilation: 1 a. List the 6 stages of compilation in order . [6 ] 1b. Create a poster or flowchart describing each of the 6 stages of compilation : 1. Lexical Analysis 2. Symbol Table Creation 3. Syntax Analysis 4. Semantic Analysis 5. Code Generation 6. Code Optimisation [ 10 total ] 10.1 - Translators Theory Topics 10.3 - Programming Errors
- 11.1 - Impacts of Technology - Eduqas GCSE (2020 Spec) | CSNewbs
Learn about the cultural, environmental, ethical and legal impacts of technology. Based on the 2020 Eduqas (WJEC) GCSE specification. 11.1: Impacts of Technology Exam Board: Eduqas Specification: 2020 What are the issues created by technology? As the use of computers and technological devices continues to rise every year, this increase brings with it a range of different types of issues . Categories of issues described on this page include: Cultural issues Environmental issues Ethical issues Legal & Privacy issues Cultural Issues Culture relates to society and how different parts of the world vary in terms of computer and internet usage . The Digital Divide This term relates to the gap between those people who have access to modern digital technology (such as computers and the internet) and those who have limited access . 'Limited access' could be devices at home or shared devices or having lower-performance (cheaper) computers and low-speed internet connections. The digital divide can be seen in different ways , such as: People in cities vs. People in rural areas . Younger people vs. Elderly people. Developed countries vs. Developing countries. The digital divide is an important ethical issue because digital technologies have led to numerous international benefits including boosted growth , improved product delivery , enhanced communication and increased opportunities . However, this impact is uneven and these positive impacts are mostly occurring in technologically-advanced regions such as North America , Western Europe and Japan . Regions like some nations in Africa and Central Asia have limited digital infrastructure and government instability , leading to poor internet speeds , high costs and limited resources . Discussion Points: What do you think can be done to bridge the digital divide? Whose job is it to bridge the gap? Who will pay for the technology? Changes to Work The internet , the development of new technologies such as cloud storage and increased video communication have transformed the way that many businesses operate across the world. Staff may be able to work from home or access documents collaboratively outside of the traditional workplace, such as cafes or on public transport. Some jobs have moved abroad to save costs, such as help centres for online issues. Tasks can be outsourced to freelancers in other countries where people are content to be paid less for their time and services. For example, some companies will hire temporary web developers from countries such as India to work for them for a lower salary than local workers. Another change to work that technology has brought is the loss of jobs , especially low-skilled jobs such as factory workers that have seen their roles replaced by technology and automation . However, technology has also created millions of new jobs , including installing and maintaining the machines that replace other roles. Environmental Issues Environmental issues concern the natural world and the negative effects of producing , using and discarding computer systems and devices. Energy and Material Consumption In the past 30 years, the number of technological devices has increased astronomically and thousands of new devices are manufactured each day . These devices need to be assembled using a range of materials , including plastics , metals and some rarer elements and need a considerable amount of electrical power to run. Certain systems like web servers and data centres must be powered on all day , every day, which uses a large amount of energy . Pollution and Waste Generating the electricity to power computers creates pollution - an average PC could require up to 50% more energy per year than a fridge. Computers are difficult to recycle and discarded components can lead to land, water and air pollution due to harmful materials , such as lead and mercury , leaking into the environment. Smartphone trends are also negative for the environment as new devices are released yearly , with minor upgrades that people buy to appear fashionable and up-to-date. To lessen the environmental impact, people should reuse and recycle their devices. Ethical Issues Ethics relates to what is considered right or wrong . Often this is subjective - people may have differing opinions on the issue. Drones Uses of drones: Filming and photography for television, movies and special events. Monitoring pollution levels in the atmosphere. Tracking and monitoring wildlife , such as rhino populations in Africa. Disaster zone response , such as searching for survivors following an earthquake. Delivery companies are developing drones to quickly deliver goods across cities. Drones are used by the military to target sites in other countries, such as American soldiers deploying surveillance drones in Syria. Discussion Points: Should you need a licence to buy and fly a drone? Should drones be used to monitor the public? Like flying CCTV? Should drones be used to deliver items? Like Amazon packages? If a drone hits a plane and it crashes, what should the punishment be? A drone is an unmanned aerial vehicle (UAV ) that is remotely operated and can be used for a wide range of purposes. Self-Driving Cars Self-driving cars (also known as autonomous vehicles ) are currently in the development and testing stage with companies like Tesla and Amazon. Benefits of self-driving cars include: In theory, driving will be safer because cars are less likely to make mistakes that humans do and they can’t become distracted or tired . Self-driving cars should be more fuel-efficient because they take the most direct route to destinations and do not get lost. ‘Drivers’ in the car can perform other tasks instead of driving, such as work or planning. Autonomous vehicles could include trucks and vans to automate the delivery and freight industries . Trucks could drive overnight to deliver goods whereas currently, human drivers must take breaks every few hours. Drawbacks of self-driving cars include: Cars could still crash as code and software processes may fail. The technology is still in development and will be very expensive for the first few years when self-driving cars are available to purchase. Jobs may be lost such as delivery and truck drivers whose vehicles are equipped with self-driving technology. Other industries like motorway services and hotels may also be affected. Discussion Points: Would you trust a car to drive itself? Who is to blame if a self-driving car crashes? The car maker? The people in the car? The software writers? What should happen to the people whose jobs are taken by self-driving vehicles? Artificial Intelligence Artificial Intelligence (AI ) is the act of computers replacing humans to analyse data and make decisions . In recent years AI has become more common in the home and on devices like smartphones; assistants such as Siri and Alexa are prime examples of modern home AI. The weather today is cloudy. Benefits of AI include: Processes are sped up as computers can analyse large amounts of data much quicker than a human. AI can be used when a human is unavailable , such as using a symptom checker on the internet for a minor illness rather than booking and waiting for a doctor. Repetitive or time-consuming tasks can instead be completed by a computer , such as searching and sorting scientific data. Drawbacks of AI include: AI can store and process a lot of personal data , especially personal assistants like Alexa which are always listening for ‘wake words’. This data can be viewed by the company that develops it and could be hacked by attackers. AI is programmed by humans and mistakes in code could have disastrous consequences if the AI is used to make important decisions , such as military deployment. Discussion Points: If a robot harms a human who is to blame? The robot? The programmer? The manufacturer? Us? Would you trust a walking, talking robot assistant in your home? Should AI make decisions for us? Legal & Privacy Issues Legal and privacy issues regard laws that have been introduced by the UK government to protect data, systems and networks from unauthorised access . See 11.2 for explanations about important computing legislation in the UK. Loss of Privacy & Hacking There has been a lot of criticism in the last few years about how internet companies and governments are using personal data to invade privacy and track civilians . Facebook was involved in a scandal with using personal data for reasons that were not the original intention. In reverse, WhatsApp and Apple have been criticised for encrypting messages sent by terrorists that police have been unable to track and read. Every week a new company seems to announce that its data has been hacked . Attackers are constantly using botnets and infected systems to crack poorly secured databases and attempting to phish individuals for usernames and passwords. In the past few years, major hacking breaches include Sony, Yahoo and TalkTalk. Discussion Points: Should the UK government be able to see the websites you have visited in the last year? What should happen if a major company is hacked and bank details are stolen? Should they be fined? Pay customers? Prison? Should WhatsApp allow authorities to access encrypted messages? What if they know a terrorist is using it to communicate? Should the UK debate privacy laws before they go into place? Online Crime Unlawfully obtaining personal information and using it for identity theft or fraud . Harassment and threatening others on social media or private messages; blackmail . Cyber attacks are more common - see 3.8 for information about DOS attacks , IP spoofing , SQL injection and more. Sharing copyrighted material such as television programmes, music and video games. Distributing prohibited material such as drugs or weapons on the dark web. See 11.2 for explanations about different laws that have been created to tackle online crime . The increased popularity of the internet and the rising number of users has led to a wave of online crime , taking many different forms, including: Q uesto's Q uestions 11.1 - Impacts of Technology: Cultural Impacts 1a. What is the digital divide ? [ 2 ] 1b. Describe 2 examples of how the digital divide can be seen . [ 2 ] 2. Describe in detail 3 ways that technology has changed the way people work . [9 ] Environmental Impacts 1. Describe the different ways that the increasing use of technology negatively impacts the environment . [ 5 ] Ethical Impacts 1a. What is a drone ? [1 ] 1b. Make a list of all of the positive impacts and the negative impacts of using drones . You should have at least 3 on each side. [ 6 ] 2. Describe 2 benefits of using self-driving cars and 2 negative consequences . [4 ] 3. Describe how artificial intelligence can be used for good . [ 2 ] Legal & Privacy Impacts 1. A hack on a bank has occurred. Describe what you think the impacts would be on the following groups of people: a. The customers . b. The bank managers . c. The general public . [ 6 ] 2. Describe 4 different types of online crime . [ 8 ] 10.3 - Programming Errors Theory Topics 11.2 - Legislation











