Search CSNewbs
304 results found with an empty search
- Key Stage 3 Python | Variables | CSNewbs
The first part of a quick guide to the basics of Python aimed at Key Stage 3 students. Learn about comments and printing. Python - #2 - Variables 1. Number Variables A variable is a value that can change . Imagine there are 20 biscuits in a jar. Then I eat one. Now there are only 19. You must state what the value of a variable is before it is used . e.g. biscuits = 20 Task 1 - Create a new Python program and save the file as 2-Variables.py Create a variable called sweets and give it the value 15. Then print sweets. Variable names cannot have spaces . You can use underscores if you want, e.g. num_of_eggs When you are printing variables, you don't put them in speech marks . Otherwise, it will print the variable name and not the value. 2. String Variables A string is a programming term for a collection of characters . When you are giving a variable a string value, it must be written in speech marks . Remember when you print the variable however, it is never printed in speech marks . Task 2 - Create a variable called name and give it the value of your name. Then print the name variable. 3. Using Variables in a Sentence When we have printed the variables so far, they have not been very informative! You can print variables together with sentences so that they mean more. Use a comma ( , ) between variables and sentences . Task 3 - Use the pictures to help you add commas and sentences to your program to be more informative. 4. Using Variables Together You can print more than one variable together in the same sentence by separating them with sentences and commas . If this doesn't work, double-check your program has a comma between each variable and sentence . Task 4 - Type a new print line that uses both your name and your sweets variables together. Use the image to help you. Challenge Programs Use everything that you have learned on this page to help you create these programs... Challenge Task 1 - Funny Animals Create a new Python program. Save it as ' 2-FunnyAnimals.py ' Add a comment at the top with your name and the date. Create a variable for a colour and give it a value (e.g. "blue") Create a variable for an animal and give it a value (e.g. "horse") Print a funny sentence that uses both variables. BONUS : Try to use only one print line. BONUS : Try to use only three lines in total . Remember: Break up variables in a print line by using commas. When you run it, it could look something like this: Challenge Task 2 - Funny Sentence Create a new Python program. Save is as ' 2-FunnySentence.py ' Add a comment at the top with your name and the date. Write a program that uses three variables, an adjective (descriptive word), a number and an animal. Print a funny response using all variables. BONUS : Try to use only one print line. BONUS : Try to use only four lines in total . Remember: Break up variables in a print line by using commas. When you run it, it could look something like this: <<< #1 The Basics #3 Inputs >>>
- Malware | Key Stage 3 | CSNewbs
Learn about different forms of malware including virus, worm and trojan. Learn about the different ways that malware can infect a computer system. Malware Malware is any type of harmful program that seeks to damage or gain unauthorised access to your computer system. Part 1: SiX Types of Malware Virus A virus can replicate itself and spread from system to system by attaching itself to infected files . A virus is only activated when opened by a human . Once activated, a virus can change data or corrupt a system so that it stops working . Trojan A trojan is a harmful program that looks like legitimate software so users are tricked into installing it . A trojan secretly gives the attacker backdoor access to the system . Trojans do not self replicate or infect other files. Ransomware Ransomware locks files on a computer system using encryption so that a user can no longer access them. The attacker demands money from the victim to decrypt (unlock) the data . ? ? Attackers usually use digital currencies like bitcoin which makes it hard to trace them. Spyware Spyware secretly records the activities of a user on a computer. The main aim of spyware is to record usernames, passwords and credit card information . All recorded information is secretly passed back to the attacker to use. Keylogger A keylogger secretly records the key presses of a user on a computer. Data is stored or sent back to the attacker. The main aim of a keylogger is to record usernames, passwords and credit card information . Keyloggers can be downloaded or plugged into the USB port . Worm A worm can replicate itself and spread from system to system by finding weaknesses in software . A worm does not need an infected file or human interaction to spread. A worm can spread very quickly across a network once it has infiltrated it. Part 2: Four ways malware cAN infect your system 1. A ccidentally downloading an infected file from an insecure website . 2. Phishing emails - clicking on attachments or links in spam emails . 3. Installing malware from a physical device, e.g. USB stick . 4. Self-replicating malware , such as worms , spreading across a network . Phishing & Staying Safe
- 3.2 - Testing - OCR GCSE (J277 Spec) | CSNewbs
Learn about why testing is needed, types of testing, types of test data and types of error. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 3.2: Testing Exam Board: OCR Specification: J277 Watch on YouTube : Purpose of Testing Types of Error Test Data The main purpose of testing is to ensure that a program works correctly no matter what input has been entered by the user. Other reasons to test a program include ensuring the user requirements have been met , errors have been removed and the program doesn't crash while running . Types of Testing Iterative Testing Iterative testing takes place during program development . The programmer develops a module , tests it and repeats this process until the module works as expected . Final Testing Final testing, also known as terminal testing , takes place after development and before the program is released to the end user. This testing takes place once all modules have been individually tested to ensure the whole program works as originally expected. Programming Errors Syntax Error Logical Error A syntax error is a mistake in the grammatical rules of the programming language , such as an incorrect spelling of a command word. A syntax error will prevent the program from being compiled and executed . Examples: Incorrect Spelling: pront ( "hello" ) Incorrect punctuation: print ( "hello" ( A logic error is a mistake made by the programmer - the program runs without crashing but will display the wrong output . Examples: Incorrect calculation: total = num1 - num2 print (total) Incorrect variable printed: age = 16 name = "Steve" print ( "Nice to meet you" , age) Test Data Test data is used to test whether a program is functioning correctly . It should cover a range of possible and incorrect inputs , each designed to prove a program works or to highlight any flaws . Four types of test data are: Normal data - Sensible data that the program should accept and be able to process . Boundary data - Data at the extreme boundary of any data ranges. Invalid data - Data of the correct data type that does not meet the validation rules (e.g. outside of the range). It should not be accepted . Erroneous data - Data of the wrong data type that the program cannot process and should not accept . Q uesto's Q uestions 3.2 - Testing: 1. Give 3 reasons why programs are tested . [ 3 ] 2. What is the difference between iterative and final testing ? [ 2 ] 3a. What is a syntax error ? Give an example . [ 2 ] 3b. What is a logical error ? Give an example . [ 2 ] 4. State and describe the four types of test data . [ 6 ] 3.1 - Defensive Design Theory Topics 4.1 - Boolean Logic
- OCR CTech IT | Unit 1 | 3.3 - Network Characteristics | CSNewbs
Learn about network topologies including client-server, peer-to-peer, bus, mesh and star. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 3.3 - Network Characteristics Exam Board: OCR Specification: 2016 - Unit 1 Network Topologies Network topology refers to the arrangement of computer systems on a network . Devices in a network topology diagram are often called ' nodes ' . Client-Server Network Clients make requests to a server , the server manages that request and responds . For example, if the user (client) makes a request to access www.csnewbs.com to a web server . Large services like Amazon and Google will need very powerful servers to handle millions of requests a second. The client is completely dependent on the server to provide and manage the information. The server controls network security , backups and can be upgraded to manage higher demand. Disadvantages: Large amounts of traffic congestion will cause the network to slow down . If a fault occurs with the server then the whole network will fail . IT technicians may be required to manage and maintain the network . Malware , such as viruses, can spread quickly across the network. Peer-to-Peer Network For peer-to-peer networks , data is shared directly between systems without requiring a central server . Each computer is equally responsible for providing data. Peer-to-peer is optimal for sharing files that can then be downloaded. Bus Topology The nodes are connected to a bus (a central cable which transfers all data on the network). How it works: The bus transfers data packets along the cable . As the data packets arrive at each computer system, the computer checks the destination address contained in the packet to see if it matches its own address . If the address does not match , the computer system passes the data packet to the next system . If the address of the computer system matches the destination address in the data packet, it is accepted and processed. At both ends of the cable are terminators to mark the end of the bus. Advantages: Because of the simple layout, it is easy to attach another system to the main cable without disrupting the whole network . A bus topology is quick to set up once the main cable has been established making it optimal for temporary networks . A bus topology is cost-effective because it usually contains less cabling than other topologies and requires no additional hardware (like a hub or switch). Disadvantages: Poor security as data packets are passed on to each system on the network. Data collisions are likely - this is when two systems attempt to transfer data on the same line at the exact same time. Resending the data wastes time and slows down the network . The main cable will only have a limited length which can become crowded and slows network speed as more systems are attached. The main cable must also be terminated properly . Token Ring Topology In a token ring network , computer systems are connected in a ring or a loop. How it works: A token (small data packet) is sent around the ring in one direction, being passed from one computer system to the next. A computer seizes the token and includes its own data when it transfers data. As the token arrives at each computer system, the system checks the destination address contained in the packet to see if it matches its own. If the addresses match, the computer processes the data otherwise it ignores it. Advantages: Data collisions are avoided as data packets are transmitted in one direction around the ring. Attaching more systems to a ring topology won't affect the transfer speed as much as other layouts like a bus topology because the data is transferred at a consistent speed . Disadvantages: If any system on the network fails then the whole network fails as the loop is broken and data can't be transferred to all systems. To add a new system to a ring topology the network must be temporarily shut down . Star Topology In a star network , each computer system is connected to a central node: a hub or switch . How it works: Each node is connected to the central node (usually a hub or switch ) and transfers its data packets here. The hub/switch looks at the destination address and transfers the packets to the intended computer only. Advantages: A star topology has improved security because data packets are sent directly to and from the hub / switch in the centre and not necessarily all devices like in a bus or ring topology. New systems can be attached directly to the central system so the network doesn't need to be shut down . System failures of attached computers won't usually cause complete network failure. Transfer speeds are generally fast in a star topology as there are minimal network collisions . Disadvantages: Extra hardware (the hub or switch) is required to be purchased, installed and maintained. If the central system (the hub or switch) fails then the whole network will be unusable until the error is fixed. Mesh Topology In a mesh network, each computer system is connected to every other computer system . How it works: Data packets are transferred to the destination address along the quickest path, travelling from node to node. If a pathway is broken, there are many alternative paths that the packets can take. Advantages: If one cable or system fails then data packets can take an alternative route and still reach the destination address. Because of the large possible number of systems and connections, a mesh topology can usually withstand large amounts of data traffic . New systems can be added to the network without disrupting the entire topology . Disadvantages: Because of the possibly large amount of cables required (especially in a complete mesh topology) this network layout can be expensive to install and maintain . Redundant cabling should be avoided - this is when cables are connected between systems that won't ever need to communicate . Configuration Before a computer system can use a network, three pieces of information must be configured (set up) correctly. IP Address An IP address is used to uniquely identify computer systems on a network , allowing communication between them. An example of an IP address is 195.10.213.120. Default Gateway When data is to be sent from one network to another , it must be sent through a default gateway . This default gateway is usually a router that connects the local network to another network . On many home networks , the default gateway will use the same private IP address : 192.168.1.1 Network managers can use automatic configuration which is quicker and easier to set up . A new device can connect to and use a network automatically , such as free WiFi in an airport. Network managers can also set manual configuration which improves security as new devices can’t be used until the addresses have been configured by a technician . This stops unauthorised devices from connecting to the network. Subnet Mask Subnetting is the act of dividing a physical network into smaller 'sub' networks (known as subnets ) . This helps to reduce traffic and means that users can externally access parts of a network (e.g. emails from home) without having to open the entire network. A subnet mask is used to define these subnets . The mask is used to determine the start and end address of each IP address in a subnet. A common subnet mask is 255.255.255.0 as making the first 3 sections full restricts the fourth section to 256 unique values. For example 113.12.14.230 and 113.12.14.157 are in the same subnet but 114.12.14.127 wouldn't be. Q uesto's Q uestions 3.3 - Network Characteristics: 1 a. Describe how peer-to-peer networks and client-server networks function. 1b. Give one use for both types of network. 2a. Draw and label a diagram for all 6 network topologies . 2b. Describe 2 advantages and 2 disadvantages of each network topology . 3 . What is an IP address ? Why is it necessary for networks? 4. Describe what is meant by a default gateway . 5a. What is subnetting ? 5b. What is the purpose of a subnet mask ? 5c. State a common subnet mask . How many unique devices can be used on a network with this subnet mask? 6. Describe 1 reason why a network manager may use automatic configuration and 1 reason why they may use manual configuration . Advantages: The network can be controlled centrally from the server to easily backup data and update software . Hardware, software and resources can be shared across the network, such as printers, applications and data files . The network allows for improved scalability , meaning more clients can be easily added to the central server . Disadvantages: Without a dedicated server there is no central device to manage security or backups . Backups must be performed on each individual system. Computer performance will decrease with more devices connected to the network, especially if other machines are slow. Advantages: This is a simpler network than client-server to set up as no server is required . Clients are not dependent on a server . Perfect for quickly sharing files between systems , such as downloading media files. 3.2 - Virtualisation Topic List 3.4 - Connection Methods
- App Inventor 2 | Pop-up Blob | CSNewbs
Learn how to use App Inventor 2 to create simple programs. Try to complete the final task (7) on this page. Perfect for Key Stage 3 students to experiment with block coding, objects and properties. App Inventor Task 7 - Pop-up Blob The previous apps have been preparing you to make a longer and more complicated app. Now we will put together all of the skills you have learned to create a fun game. Check the video: Open App Inventor 2 (use the button below) and create a new project. You will need to log in with a Google account. App Inventor 2 Ready for a challenge? This is what the program looks like in Designer layout. To the left are the components with all their Properties correct. To the right are the Components names. Put the three labels and button inside a HorizontalArrangement from the Layout section of Palette . The Text for ScoreLabel is 'Score: 0'. The Text for TimeRemainingLabel is 'Time Remaining:'. The Text for SecondsLabel is '20'. Place an ImageSprite inside a Canvas (both from the Drawing and Animation section of Palette ). Download the blob image from the Basics page here and upload it as the Picture for the ImageSprite . Change to Blocks layout and drag a initialize global to block from Variables . Type 'Score' in the empty space to create a variable that we will use to track how many times the blob has been touched. Attach a 0 block from Math to start the score at 0. This big block of code uses some of the concepts which you have used before. Whenever the Blob is touched the variable Score is increased by 1. The X and Y coordinates of the Blob are changed by random numbers so it will appear in a random location on the screen. The bottom blocks change the ScoreLabel to show the current score. Every second that the timer ticks we want to check if the score is more than 1 (to check it hasn't reached 0). If it is more than 1 second then the time will count down by 1. In the else part you need to add the following: Set Blob Enabled to false . Set Blob Visible both to false . Set TimeRemainingLabel Visible to false . Set SecondsLabel Visible to false . When the Reset Button is clicked the score variable is changed to 0 and the Seconds label is rewritten to 0. Make sure you use the " " block from Text and not a block from Math. Inside the when ResetButton Click block you need to reverse the code you have added for the else block when the timer ticks: Set Blob Enabled to true . Set Blob Visible both to true . Set TimeRemainingLabel Visible to true . Set SecondsLabel Visible to true . Extra Step: Challenges 1. Large score display . If you watch the video at the top of the page again, you will see that when the time runs out (is less than 1) some of the labels turn invisible and the TextColour and FontSize of the ScoreLabel changes. Try to do the same in your app. Remember to reverse what you have done in the code for the reset button; otherwise, the labels will still be invisible! 2. Customise your game . Change the background of the Canvas to an image, change the blob to a different image and add a sound when the character is 'popped'. 3. *HARDER Challenge* Add a High Score Label . Follow these hints carefully and use the colours to help you. You need to initialize a new Variable called HighScore and set it to 0 . You also need to add a new HighScoreLabel and put it in your Horizontal Arrangement in Designer layout. Add an if then block in the else part of the When Timer Timer block you already have. If Score > HighScore then HighScore = Score . This will change the value of HighScore to the current Score if it is higher than the current high score. Remember to make the HighScoreLabel display the new HighScore . KS3 Home
- 5.1 - Data Types & Sources | Unit 2 | OCR Cambridge Technicals | CSNewbs
Learn about the different types of data and information sources. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification for Unit 2 (Global Information). 5.1 - Data Types & Sources Exam Board: OCR Specification: 2016 - Unit 2 Sources of Information Internal Source Information that comes from within an organisation , such as financial reports, data analysis or employee surveys. External Source Information that comes from outside of an organisation , such as government reports, financial data of competitors or price lists from suppliers. Types of Data Primary Data Data that has been created and collected by yourself or another employee within an organisation . For example, interviews or questionnaires sent within the company. Secondary Data Data that has been created and collected by someone outside of the organisation , such as national census data collected by the government or surveys taken by a competitor. Some secondary data may need to be purchased . Qualitative Data This is descriptive data , often composed of text , that can be observed but not measured . For example, survey responses where customers are asked why they visit a particular shop. Quantitative Data This is measured data , often in the form of numbers , percentages or statistics . For example, survey responses of the amount of time it takes to reach a shop. Q uesto's Q uestions 5.1 - Data Types & Sources: 1. A supermarket wants to find out how many of their customers have bought peaches this year compared to customers at a rival shop . Describe data that they could use for each of the source and data types below (e.g. stock information for peaches in the supermarket would be an internal source of information). Internal source External source Primary data Secondary data Qualitative data Quantitative data [6 ] "Why do you visit this supermarket?" 'Because it is close to home.' 'I like the easy access to parking.' 'I've always gone here.' "How many minutes does it take you to get here ?" 10 25 30 4.3 - Green IT Topic List 5.2 - Data Flow Diagrams
- 6.1 - Legal Considerations | F161 | Cambridge Advanced National in Computing | AAQ
Learn about legislation and regulations related to application development, including the Data Protection Act, Computer Misuse Act and Freedom of Information Act. Resources based on Unit F161 (Developing Application Software) for the OCR Cambridge Advanced Nationals in Computing (H029 / H129) AAQ (Alternative Academic Qualification). Qualification: Cambridge Advanced Nationals in Computing (AAQ) Certificate: Computing: Application Development (H029 / H129) Unit: F161: Developing Application Software 6.1 - Legal Considerations Watch on YouTube : Computer Misuse Act Data Protection Act UK General Data Protection Regulation Freedom of Information Act Privacy and Electronic Communications Regulations Independent bodies UK Information Commissioner's Office You need to know the latest version and main purpose of each act /regulation , as well as actions taken to comply with the act and the impacts of not complying with it. You must also understand how Privacy and Electronic Communications Regulations (PECR ) relate to the Data Protection Act and UK General Data Protection Regulation (UK GDPR ), and the role of the Information Commissioner's Office (ICO ) in the UK. What You Need to Know Computer Misuse Act ? YouTube video uploading soon Data Protection Act ? YouTube video uploading soon UK GDPR ? YouTube video uploading soon Freedom of Information Act ? YouTube video uploading soon PECR ? YouTube video uploading soon ICO & Independent Bodies ? YouTube video uploading soon Q uesto's Q uestions 6.1 - Legal Considerations: 1. What? [2 ] 2. What? [1 ] 3. What? [1 ] 4. What? [1 ] ? D id Y ou K now? 5.3 - Policies Topic List
- Python | Extended Task 4 | CSNewbs
Test your ability to create a more complex program in Python based on a given scenario. Perfect for students learning GCSE Computer Science in UK schools. Extended Task 4 Hi, Jacob Mortimer here from Cats & Dogs Veterinary Surgery . There was a flood last week, and our computer systems were totally destroyed . I need you to create a program , using a file , that allows my receptionist to: Add new animals to the file . Search through the file and print the details of a specific animal . Allow a specific animal to be removed from the file . Vet Surgery For this task, you will need to create a document and include the following sections (with screenshots where appropriate): An introduction to explain the Purpose of your program . A List of Requirements for a successful program. Screenshots of your code (with comments in your code to show understanding). Testing – Create a plan to show how you will test your program and then explanations of any errors that you found and how they were fixed . An Evaluation of what worked, what didn’t, and how you met each of your requirements from your original list. Also, discuss further improvements that you could have made to improve your program. Reminders for this task: You will need to create a selection of options for the user to choose from. Subroutines and a while true loop may help. Section 10 will help you to open, write and read from files . Section 10c shows how to edit data in a file. You will need to adapt this code and not write the line that has been selected, instead of writing a modified version of it. There are multiple ways to approach this program, and your solution might look different from the example. Break the problem down and focus on one part at a time. Example solution: Entering 1 allows the user to enter the details of a new animal which is saved into the file . Entering 4 will stop the loop and ends the program. Entering 2 allows the user to enter the details of an animal to search for . If the animal is in the file, their details are printed clearly on a new line. Entering 3 allows the user to enter the details of an animal to remove from the file . If the animal is in the file, all lines are transferred into a temporary file except for the line to be removed . ⬅ Extended Task 3 (Blackjack) Extended Task 5 (Colour Collection) ➡
- 3.1 - Network Characteristics - Eduqas GCSE (2020 spec) | CSNewbs
Learn about the advantages and disadvantages of networks, the five types of network - LAN, WAN, PAN, MAN and VPN - and differences between wired and wireless networks. Based on the 2020 Eduqas (WJEC) GCSE specification. 3.1: Network Characteristics Exam Board: Eduqas / WJEC Specification: 2020 + What is a network? A network is more than one computer system connected together allowing for communication and sharing of resources . There are many benefits but also some drawbacks to using a network compared to having an unconnected ('standalone' ) computer: Advantages of Networks Easily share files , software and hardware between computers. Disadvantages of Networks There is an initial cost because network devices like routers are required . Larger companies will need to buy and maintain a server . Log in from any connected computer and access your data and files. A network manager / administrator might need to be employed to maintain the network . An administrator can monitor network activity and control security settings. Data from computers on the network can be automatically backed up on central storage. Security breaches are more likely and malware , such as worms, can spread quickly across the network. If the web server fails , all connected computers won't be able to access files or log on . Network Types Networks can be split into different types , usually categorised by their geographical distance apart and the area that they serve. Local Area Network A local area network (LAN ) has computer systems situated geographically close together , usually within the same building or small site , like a school or office . Wide Area Network A wide area network (WAN ) has computer systems situated geographically distant to each other, possibly across a country or even across the world . The internet is an example of a WAN that spans the globe. Personal Area Network A PAN is a personal network for an individual , such as a photographer connecting a smartphone, desktop computer and printer together. Metropolitan Area Network A MAN is larger than a LAN but smaller than a WAN and typically covers a relatively large area like a university campus, town or city . Virtual Private Network A VPN allows for a secure and encrypted connection to a public network like the internet. It is often used to protect an individual's privacy by concealing their real location. Wired & Wireless Networks Wired Connections Wireless Connections Wireless connections, such as WiFi or Bluetooth , use no cables but require a wireless network interface card (WNIC ). Wireless connections generally have a slower speed and can be affected by the computer's distance from the wireless router as well as obstacles like walls or bad weather. Wired connections use physical cables , such as copper or fibre optic wires , and require a network interface card (NIC ) to connect to a network. These wired connections use a wired connection protocol - most commonly Ethernet . Restricted Movement Faster More Secure NIC Required Freedom of Movement Slower Less Secure WNIC Required Q uesto's Q uestions 3.1 - Network Characteristics: 1. A retirement home for the elderly is considering installing a LAN , give 3 benefits and 3 drawbacks they might find of using a network . [6 ] 2a. Describe the difference between a LAN and WAN . [2 ] 2b. Give an example of how a LAN and a WAN could each be used . [ 2 ] 3 . Explain the differences between a PAN , MAN and VPN . [ 3 ] 4. For each of the scenarios below, state which network type would be most suitable : a. The IT rooms of a secondary school . [ 1 ] b. A study in a house with a desktop and printer. [ 1 ] c. Using online banking when abroad on a holiday to stay secure . [ 1 ] d. A large technology company with offices across Europe . [ 1 ] e. Council offices with several locations across Manchester . [ 1 ] 5. Briefly compare wired and wireless networks . [ 8 ] 2.2 - Boolean Algebra 3.2 - Data Packets & Switching Theory Topics
- 1.5 - Performance - Eduqas GCSE (2020 spec) | CSNewbs
Learn about the three factors that affect computer performance - cache memory size and levels, clock speed and the number of cores. Based on the 2020 Eduqas (WJEC) GCSE specification. 1.5: Performance Exam Board: Eduqas / WJEC Specification: 2020 + The performance of a computer system is affected by three main factors: Cache Memory: Size & Levels What is cache memory? Cache memory is temporary storage for frequently accessed data . Cache memory is very quick to access because it is closer to the CPU than other types of memory like RAM . What are the 3 levels of cache memory? Level 1 cache is the smallest level but it is also the fastest . Level 2 cache is larger than level 1 but slightly slower. Level 3 cache is located outside of the CPU core which makes it slower than the first two levels but it is much larger . How does cache memory work? When the CPU searches for data , it looks first in level 1 cache, then level 2 and then level 3 . If the data has been found , this is called a 'cache hit '. If the data is not found then the CPU searches in RAM instead which takes more time - this is called a 'cache miss '. How does cache memory improve performance? Cache memory is closer to the CPU than RAM , meaning that it can provide data and instructions to the CPU at a faster rate . A computer with more cache memory (e.g. 8MB instead of 4MB) should have a higher performance because repeatedly used instructions can be stored and accessed faster . Larger level 1 and level 2 cache sizes will improve a computer's performance as data can be accessed extremely quickly . What is the limitation of cache memory? Cache memory is costly, so most computers only have a small amount . Multiple cache misses will result in data latency (delay) as information is accessed from RAM which is further away from the CPU. Clock Speed What is clock speed? Clock speed is the measure of how quickly a CPU can process instructions . Clock speed is measured in Gigahertz (GHz) . A typical desktop computer might have a clock speed of 3.5 GHz . This means it can perform 3.5 billion cycles a second . How does clock speed improve performance? The faster the clock speed, the faster the computer can perform the FDE cycle resulting in better performance because more instructions can be processed each second . How does overclocking and underclocking affect performance? Typical clock speed: 3.5 GHz Underclocking Overclocking 3.9 GHz 3.1 GHz Overclocking is when the computer's clock speed is increased higher than the recommended rate. This will make the computer perform faster, but it can lead to overheating and could damage the machine . Underclocking is when the computer's clock speed is decreased lower than the recommended rate. This will make the computer perform slower but will increase the lifespan of the machine . Number of Cores What is a core? A core is a complete set of CPU components (control unit, ALU and registers). Each core is able to perform its own FDE cycle . A multi-core CPU has more than one set of components within the same CPU. How does the number of cores improve performance? In theory, a single-core processor can execute one instruction at a time , a dual-core processor can execute two instructions, and a quad-core can execute four instructions simultaneously . Therefore, a computer with more cores will have a higher performance because it can process more instructions at once . What are the limitations of having more cores? If one core is waiting for another core to finish processing, performance may not increase at all. Some software is not written to make use of multiple cores , so it will not run any quicker on a multi-core computer. Q uesto's Q uestions 1.5 - Performance: Cache Size & Levels 1a. What is cache memory ? [ 2 ] 1b. Describe the three levels of cache memory . [ 3 ] 1c. Describe what is meant by a ' cache hit ' and a ' cache miss '. [ 2 ] 1d. Describe two ways that more c ache memory will mean performance is higher . [ 4 ] 1e. Explain why most computers only have a small amount of cache memory. [ 1 ] Clock Speed 2a. What is clock speed ? What is it measured in? [ 2 ] 2b. Explain how a higher clock speed improves performance . [ 2 ] 2c. Explain the terms 'overclocking ' and 'underclocking ' and explain the effects of both on the performance of a computer. [ 4 ] Number of Cores 3a. What is a core ? [ 2 ] 3b. Explain why a quad-core processor should have a higher performance than a dual-core processor . [ 3 ] 3c. Explain two reasons why having more cores doesn't necessarily mean the performance will be better . [ 2 ] 1.4 - Secondary Storage 1.6 - Additional Hardware Theory Topics
- 1.2 - CPU Performance - OCR GCSE (J277 Spec) | CSNewbs
Learn about the three factors that affect computer performance - cache memory, clock speed and the number of cores. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). 1.2: CPU Performance Exam Board: OCR Specification: J277 Watch on YouTube : Clock Speed Cache Memory Number of Cores The performance of a computer system is affected by three main factors: Cache Memory What is cache memory? Cache memory is temporary storage for frequently accessed data . How does cache memory improve performance? Cache memory is closer to the CPU than RAM , meaning that it can provide data and instructions to the CPU at a faster rate . A computer with more cache memory (e.g. 8GB instead of 4GB) should have a higher performance because repeatedly used instructions can be stored and accessed faster . What is the limitation of cache memory? Cache memory is costly, so most computers only have a small amount . Clock Speed What is clock speed? Clock speed is the measure of how quickly a CPU can process instructions . Clock speed is measured in Gigahertz (GHz) . A typical desktop computer might have a clock speed of 3.5 GHz . This means it can perform 3.5 billion cycles a second . How does clock speed improve performance? The faster the clock speed, the faster the computer can perform the FDE cycle resulting in better performance because more instructions can be processed each second . How does overclocking and underclocking affect performance? Default clock speed: 3.5 GHz Underclocking Overclocking 3.9 GHz 3.1 GHz Overclocking is when the computer's clock speed is increased higher than the recommended rate. This will make the computer perform faster, but it can lead to overheating and could damage the machine . Underclocking is when the computer's clock speed is decreased lower than the recommended rate. This will make the computer perform slower but will increase the lifespan of the machine . Number of Cores What is a core? A core is a complete set of CPU components (control unit, ALU and registers). Each core is able to perform its own FDE cycle . A multi-core CPU has more than one set of components within the same CPU. How does the number of cores improve performance? In theory, a single-core processor can execute one instruction at a time , a dual-core processor can execute two instructions, and a quad-core can execute four instructions simultaneously . Therefore, a computer with more cores will have a higher performance because it can process more instructions at once . What are the limitations of having more cores? If one core is waiting for another core to finish processing, performance may not increase at all. Some software is not written to make use of multiple cores , so it will not run any quicker on a multi-core computer. Q uesto's Q uestions 1.2 - CPU Performance: Cache Size & Levels 1a. What is cache memory ? [ 2 ] 1b. Describe two ways that more c ache memory will mean performance is higher . [ 4 ] 1c. Explain why most computers only have a small amount of cache memory. [ 1 ] Clock Speed 2a. What is clock speed ? What is it measured in? [ 2 ] 2b. Explain how a higher clock speed improves performance . [ 2 ] 2c. Explain the terms 'overclocking ' and 'underclocking ' and explain the effects of both on the performance of a computer. [ 4 ] Number of Cores 3a. What is a core ? [ 2 ] 3b. Explain why a quad-core processor should have a higher performance than a dual-core processor . [ 3 ] 3c. Explain two reasons why having more cores doesn't necessarily mean the performance will be better . [ 2 ] 1.1b - Registers & FE Cycle 1.3 - Embedded Systems Theory Topics
- Python | 5c - Date & Time | CSNewbs
Learn how to use time commands to display the current date and time in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 5c - Time & Date ctime() The easiest way to output the current time and date is to use the ctime() command. Import the ctime command from the time library before you use and print it: from time import ctime print ( "Current time:" , ctime()) = Current time: Wed Sep 13 16:07:20 2023 This will print the time and date, but it looks rather unprofessional, and the exact format depends on the type of system that you are currently running so it may vary for different users. Date / Time Task 1 ( Dentist Surgery) Print a greeting for a dentist surgery with the current date and time. Example solution: Welcome to Greenvale Dentist Surgery, it is currently: Wed Sep 13 16:16:24 2023 strftime() A better alternative to the ctime() command is to use strftime() which stands for str ing f rom time as you can select specific parts of the date and time to display. This command requires a directive to be written with a percentage symbol as a string in the brackets . For example, the current hour (%H ), minute (%M ) and second (%S ) can be printed between colons to show the time . from time import strftime print ( "The current time is" , strftime( "%H:%M:%S" )) = The current time is 13:18:57 There are many different directives that you can use to display exactly what you are looking for, such as: from time import strftime day = strftime( "%A" ) print ( "The current day is" , day) month = strftime( "%B" ) print ( "The current month is" , month) year = strftime( "%Y" ) print ( "The current year is" , year) = The current day is Thursday The current month is September The current year is 2023 The following directives can be used with strftime(). Don't forget that directives must be typed within speech marks . Date - Weekday: %a – Current day of the week abbreviated (e.g. Sun, Mon) %A – Current day of the week in full (e.g. Sunday, Monday) %w – Current day of the week in chronological order (0 is Sunday and 6 is Saturday) %W – Current week number (e.g. 01, 26, 52) Month: %d – Current day of the month (e.g. 01, 11, 31) %m – Current month as a number (e.g. 01, 06, 12) %b – Current month abbreviated (e.g. Jan, Jun, Dec) %B – Current month in full (e.g. January, December) Year: %y – Current year abbreviated (e.g. 16, 17) %Y – Current year in full (e.g. 2016, 2017) %j – Current day of the year (e.g. 001, 150, 365) Time - Hour: %H – Current hour in 24-hour clock (e.g. 00, 12, 20) %I – Current hour in 12-hour clock (e.g. 01, 08, 12) %p – Whether it is currently AM or PM Minute: %M – Current minute (e.g. 00, 30, 59) Second: %S – Current second (e.g. 00, 30, 59) More Directives - %z – Current time difference from UTC (Co-ordinated Universal Time) (e.g. +0000, -0500, +1100) %Z – Current time zone (e.g. GMT Standard Time, EST, CST) Just looking for a quick date or time display and not bothered about customisation? Try these: %c – Current date and time in full (e.g. Tue Feb 19 13:35:20 2016) %x – Current date (e.g. 19/02/16) %X – Current time (13:36:20) Date / Time Task 2 ( Calendar App ) Create a program that asks the user if they want to see the current date , the current time or 'other '. Use the strfftime directives above to show what the user asks for. It's up to you which directives you use for the 'other' option , such as displaying the current day of the year (%j ) or current week of the year (%W ). Example solutions: Type TIME for the current time, DATE for the current date or OTHER: TIME The current time is 13:46PM Type TIME for the current time, DATE for the current date or OTHER: DATE The date today is Thursday 14 September 2023 Type TIME for the current time, DATE for the current date or OTHER: OTHER Did you know today is day number 257 of 2023? Between Dates You may want to work out the number of days between two dates . This can be done by importing the date command from the timedate library. Below is a simple example: from datetime import date date1 = date(2021,9,15) date2 = date(2022,1,20) difference = date2 - date1 print ( "There are" , difference.days , "days between" , date1 , "and" , date2) Make sure the date is entered in the format of year, month, day . The .days code removes the difference in hours and seconds to just display the number of days difference. There are 127 days between 2021-09-15 and 2022-01-20 Today's Date The program here uses strftime to check the current year, month and day and organise it into the date format . This can then be used together with code similar to the program above to check the number of days between one specific date and the current date. from datetime import date from time import strftime thisyear = int (strftime( "%Y" )) thismonth = int (strftime( "%m" )) thisday = int (strftime( "%d" )) todaysdate = date(thisyear,thismonth,thisday) print ( "The date today is" , todaysdate ) The date today is 2023-09-14 Input a Date The program here shows how to input a date into a format that can then be used by Python to work out the difference between two dates . from datetime import date year = int ( input ( "Enter a year: " ) month = int ( input ( "Enter a month: " ) day = int ( input ( "Enter a day: " ) chosendate = date(year,month,day) print ( "The chosen date is" , chosendate ) Enter a year: 1964 Enter a month: 5 Enter a day: 13 The chosen date is 1964-05-13 Date / Time Task 3 ( Days Alive) Create a program that works out how long the user has been alive for . Use the examples above to automatically make today's date and then allow the user to input their year , month and day of birth. Get Python to work out the difference between today and their date of birth. Example solutions: Enter a year: 1998 Enter a month: 3 Enter a day: 29 You have been alive for 9300 days! Enter a year: 2007 Enter a month: 12 Enter a day: 25 You have been alive for 5742 days! ⬅ 5b - Sleep 5d - Colorama ➡









