top of page

Search CSNewbs

286 items found for ""

  • Python | 7b - Functions | CSNewbs

    top Python 7b - Functions What is a Function? A function is a subroutine that takes one or more values from the main program and returns a value back. For example, transferring over a sphere’s radius from the main program for the function to calculate a surface area and then return that value to the main program. The two key differences between procedures and functions are: A function uses parameters to transfer data from the main program into the function. A function returns a value to the main program. Writing Functions A function is written the same way as a procedure but it uses parameters . In the example below the parameters are num1 and num2 which are sent from the main program to be used in the function . The return command is used to send a value back to the main program . Below is another example of a function that takes the radius of a sphere and works out the area in a separate function . ​ The area is returned to the main program and printed. Subroutines can be reused and called with different parameters . ​ The program below repeatedly takes an integer input and adds it to a total in a function that is then returned and printed. Practice Task Create a program similar to the sphere example above, this time to work out the volume of a cylinder. ​ In the main program ask the user to enter the cylinder's radius and then its height. ​ The actual calculation should be done in a function and returned to the main program. ​ The calculation for a cylinder's volume is: ​ pi x (radius x radius) x height ​ Extension: Use the round command from section 9b to round the number to 2 decimal places. Example solution: Using Subroutines as a Menu Subroutines are often used to split programs up and give users a selection of options . ​ Subroutines are used for this purpose because they are separate , making it easier to code and manage a program . ​ The example below for a simplified online banking system uses separate subroutines accessible within a while true loop . ​ Depending on the option chosen by the user, the appropriate subroutine will be called . Instead of a further practice task here, Task 4 of the Section 7 Practice tasks page challenges you to make a similar program using multiple subroutines. ⬅ 7a - Proced ures Section 7 Practice Tasks ➡

  • 3.2 - Testing - OCR GCSE (J277 Spec) | CSNewbs

    3.2: Testing Exam Board: OCR Specification: J277 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: 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 ] 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 . 3.1 - Defensive Design Theory Topics 4.1 - Boolean Logic

  • Python | Section 1 Practice Tasks | CSNewbs

    top Python - Section 1 Practice Tasks Task One: Weekdays Create a program that prints all 5 weekdays , with each day on a new line . ​ Requirements for a complete program: Use only one print line - use \n . No empty space at the start of a printed line. Example solution: Monday Tuesday Wednesday Thursday Friday Task Two: Colour & Animal Sentence Write a program that uses two variables , one for a colour and one for an animal . Print a sentence using both variables . Requirements for a complete program: Use both your variables within one print line. Include capital letters, appropriate punctuation and no irregular spacing in the printed line. ​ Remember: Break up variables in a print line by using commas or plus signs between each part of the "sentence" . Example solutions: Have you ever seen a purple cat? A horse that was green galloped past! Three yellow ants ate my lunch. Task Three: Number, Adjective & Animal Write a program that uses three variables , a number , an adjective (descriptive word) and an animal . Print a sentence using all three variables . ​ Requirements for a complete program: ​ Use all three variables within one print line. Include capital letters, full stops and no irregular spacing in the printed line. ​ Remember: Break up variables in a print line by using commas or plus signs between each part of the "sentence" . Example solutions: What? 64 sneaky elephants just ran past me! There were 12 hungry bears in the park. 85 patient spiders waited in the corner. ⬅ 1d - Using Va riables 2a - Inputting Text ➡

  • App Inventor 2 | The Basics | CSNewbs

    What is App Inventor? App Inventor 2 Link App Inventor 2 is software developed by Massachusetts Institute of Technology (MIT ), a research university in America. ​ It allows users to create simple apps and learn about the way that they work in a fun manner. There is no need to learn how to program with text editors as everything is based around blocks, a bit like Scratch. ​ To open App Inventor 2 (the current version of the program) click the button in the top right. You will need to log in with a Google account. ​ There are two layouts to App Inventor, Designer and Blocks . You can switch between them with the bottoms in the top right corner. ​ This guide will show you how to make seven simple programs and introduce you to programming concepts such as variables and properties . Download all App Inventor images you will need for the 7 tasks by clicking the camera icon. Note to Computer Science Teachers - The easiest way to test programs made using App Inventor 2 is using the emulator which should be pre-installed by the IT technician team at your school. See here for information on how to set it up. Also, Google accounts are required to access and use App Inventor 2. Viewer - This is a mock-up of what your app will look like. Components - Each component can be renamed or deleted here. Designer Layout Palette - Drag the component that you want to use in your app, into the centre. Properties - Edit the settings for each component. Media - Upload images and sound here before they can be used in your app. Blocks Layout Viewer - This is space for you to drag blocks to make things happen. Blocks - Drag the code block that you want to use into the centre. The blocks connect together like in Scratch. Warnings - Any errors with your code will be displayed here. Backpack - Drag code into to backpack to store it for later. KS3 Home Tasks 1 & 2

  • Computer Science Newbies

    C omputer S cience Newb ie s Popular CSNewbs topics: Latest update: ​ Using GUIs with Python Programming PYTHON GCSE Computer Science OCR GCSE Computer Science EDUQAS OCR Cambridge Technicals Level 3 IT You are viewing the mobile version of CSNewbs. The site may appear better on a desktop or laptop . Programming HTML CSNewbs last updated: Tuesday 8th October 2024 Over 474,000 visits in the last year! About CSNewbs

  • 1.1a - The CPU - OCR GCSE (J277 Spec) | CSNewbs

    Exam Board: OCR 1.1a: The CPU Specification: J277 The Central Processing Unit ( CPU ) is the most important component in any computer system. ​ Like many components of a computer, it is attached to the motherboard . ​ The purpose of the CPU is to process data and instructions by constantly repeating the fetch - execute cycle . CPU Components The Control Unit (CU ) sends control signals to direct the operation of the CPU . Control signals and timing signals are sent to the ALU and other components such as RAM . It also decodes instructions as part of the F-E cycle . ALU stands for ‘ Arithmetic and Logic Unit ’. It performs simple calculations and logical operations . A register is a temporary storage space for one instruction or address . ​ Different registers are used during the FE cycle . Cache memory is used to temporarily store data that is frequently accessed . ​ Cache memory is split into different levels . Cache is slower to access than the registers but much faster than RAM . Computer Architecture The way a computer is designed and structured is known as its architecture . ​ The most common type of computer architecture is Von Neumann . Von Neumann Architecture This architecture is named after John von Neumann who developed the concept of a stored program computer in the 1940s. Before being able to store programs in memory , instructions had to be manually input by a human. ​ A computer with Von Neumann architecture stores both program instructions and data in the same memory (RAM ). Other architectures like Harvard have two separate memories - one for program instructions and another for data. ​ Data is transferred between components on pathways called buses . Q uesto's Q uestions 1.1a - The CPU: ​ 1a. What does 'CPU ' stand for ? [1 ] 1b. What is the purpose of the CPU ? [ 2 ] ​ 2. Draw a diagram of the CPU , and l abel the four main components . [ 4 ] ​ 3. Describe the purpose of: a. The Control Unit [ 2 ] b. The ALU [ 2 ] c. The registers [ 2 ] d. Cache memory [ 2 ] ​ 4. Describe the key feature of Von Neumann architecture . [ 2 ] 1.1b - Registers & FE Cycle Theory Topics

  • 2.2.2b - Object Oriented Programming | OCR A-Level | CSNewbs

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

  • 5.1 - Operating Systems - OCR GCSE (J277 Spec) | CSNewbs

    5.1: Operating Systems Exam Board: OCR Specification: J277 What is an Operating System? An operating system (OS ) is software that helps to manage the resources of a computer system and provide the interface between the user and the computer’s hardware . ​ There are five main functions of an operating system: Memory Management & Multitasking All programs must be temporarily stored in RAM for the CPU to be able to process them. ​ The OS transfers programs in and out of memory from the hard drive (or virtual memory ) when processing is required - programs are removed from RAM when closed to free up space for other tasks. ​ The operating system can only perform one process at a time , but through memory management it can appear that more than one process is being executed - this is called multitasking . Peripherals Management & Drivers A peripheral is an external device connected to a computer system to input or output data . Data is transferred between external devices and the processor and this process needs to be managed by the operating system . ​ A device driver is a program that provides an interface for the OS to interact and communicate with an external device . Drivers are hardware dependent and OS-specific . The driver translates the OS’ instructions into a format the specific hardware can understand . Because the CPU and the peripheral will process data at different speeds , a buffer is typically used to temporarily store data until it can be processed . User Management The OS allows users to create , manage and delete individual accounts . User accounts can be granted different access rights such as an administrator or guest . The OS will manage security settings such as allowing passwords to be reset and can also be used to monitor login activity . File Management The operating system creates and maintains a logical management system to organise files and directories (folders ). ​ File management allows files to be named , renamed , opened , copied , moved , saved , searched for , sorted and deleted . It also allows users to set access rights for specific files and to view file properties . User Interface The final function of an operating system is to provide a user interface , allowing a human to interact with the computer system . The way in which a user can navigate a computer system is known as human-computer interaction ( HCI ). Graphical User Interface (GUI) The most common type of user interface is a graphical user interface (GUI ) which can be presented in the following ways: Icons are displayed to represent shortcuts to applications and files. Multiple windows can be opened at the same time and switched between. A folder and file system is displayed and manipulated allowing for copying , searching , sorting and deleting data. The interface can be customised , such as changing font sizes and the desktop background . The taskbar allows shortcuts to be pinned for quick access . Menus can be opened from the Start button to display files and shortcuts. System settings can be accessed such as network and hardware options . Command-Line Interface Other types of user interface do exist, such as a command-line interface (CLI ). This type of interface is entirely text-based and requires users to interact with the system by typing commands . This is a complicated process and mistakes could easily accidentally delete data. There are many commands to learn so only experts who have been trained t o learn this interface will be able to efficiently make use of it. Menu-Driven Interface A menu-driven interface displays data in a series of linked menus . Examples include cash machines (ATMs) and old iPods . ​ This type of interface is generally user friendly and easy to use as commands do not need to be memorised. However it can be annoying to find specific data through a large number of menus without a search feature. Touch-Sensitive Interface Another type of user interface is a touch-sensitive interface , used with smartphones and tablets . ​ A human interacts with the device by pressing on a touchscreen , making it very intuitive and suitable for most users without training. Touch-sensitive interfaces may not work with dirty or wet fingers and it will take longer to write text compared to using a keyboard. Voice-Driven Interface A voice-driven interface can be controlled by speaking commands aloud to a listening device. Examples include Amazon's Alexa devices, Apple's Siri technology and Google Home . ​ This interface is intuitive , can be used hands-free and helps to speed up processes . However commands may be misheard or limited in what can be performed. Q uesto's Q uestions 5.1 - Operating Systems: ​ 1. Describe each role of the operating system : Providing a user interface [ 3 ] Memory management (and multitasking) [ 3 ] Peripheral management (and drivers) [ 3 ] User management [ 3 ] File management [ 3 ] ​ 2. Describe 5 different ways the operating system can provide a graphical user interface (GUI) . [5 ] ​ 3. Describe one advantage and one disadvantage of using the following types of human-computer interaction (HCI) : a. Command-Line interface [ 4 ] b. Touch-Sensitive interface [ 4 ] c. Menu-Driven interface [ 4 ] d. Voice-Driven interface [ 4 ] 4.2 - Preventing Vulnerabilities Theory Topics 5.2 - Utility Software

  • 2.2.1b - Modularity & IDE | OCR A-Level | CSNewbs

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

  • Unit 1 - Fundamentals of IT - Cambridge Technicals | CSNewbs

    OCR Cambridge Technicals IT Level 3 Unit 1: Fundamentals of IT These pages are based on content from the OCR Cambridge Technicals 2016 Level 3 IT specification . This website is in no way affiliated with OCR . LO1 (Computer Hardware ) 1.1 - Computer Hardware 1.2 - Computer Components 1.3 - Types of Computer System 1.4 - Connectivity 1.5 - Communication Hardware 1.6 - Hardware Troubleshooting 1.7 - Units of Measurement 1.8 & 1.9 - Number Systems & Conversion LO2 (Computer Software ) 2.1 - Types of Software 2.2 - Applications Software 2.3 - Utility Software 2.4 - Operating Systems 2.5 - Communication Methods 2.6 - Software Troubleshooting 2.7 - Protocols LO3 (Networks & Systems ) 3.1 - Server Types 3.2 - Virtualisation 3.3 - Network Characteristics 3.4 - Connection Methods 3.5 - Business Systems LO4 ( Employability & Communication ) 4.1 - Communication Skills 4.2 - Communication Technology 4.3 - Personal Attributes 4.4 - Ready for Work 4.5 - Job Roles 4.6 & 4.7 - Bodies & Certification LO5 (Issues & Security ) 5.1 - Ethical Issues 5.2 - Operational Issues 5.3 - Threats 5.4 - Physical Security 5.5 - Digital Security 5.6 - Data & System Disposal

  • 1.1 - Holders of Information | Unit 2 | OCR Cambridge Technicals | CSNewbs

    1.1 - Holders of Information Exam Board: OCR Specification: 2016 - Unit 2 Categories of Information Holders Organisations that store and process information can be put into seven different categories : Business A business will hold information on all of its employees , including their date of birth, address and financial information , allowing them to be paid at the end of each month. Businesses will also hold commercial information about their organisation such as profits and losses, product descriptions and historical data . Many companies may record information about their competitors and general marketing data. Government The government will hold a huge amount of information about all citizens in the country including financial earnings, tax paid, births and deaths . The electoral roll holds information about addresses . A national census is taken every 10 years in the UK (the next census is in 2021) that records extensive data about everyone living in the country. The government also stores information about other countries and shares some of this publicly, such as the Foreign Office posting travel advice . Individual Education Educational organisations , such as schools, colleges and universities will hold information about current and past students as well as staff. Student information such as addresses, attendance records and examination history will be recorded, as well as contact information for parents and guardians. Teacher information will be stored too, as well as students that previously attended the institution, even for a number of years after they have left. An individual will hold information about themselves , either in their head or on paper or electronically. This includes their name, date of birth, address, usernames and passwords . Individuals will store information of others , such as phone numbers, social media details and email addresses . Other information will be about organisations , such as the address of their favourite restaurant, opening hours of the local cinema or the telephone number from a catchy advert. Healthcare Healthcare services , like the NHS in the United Kingdom, will hold entire medical histories for each civilian in the country. This includes basic personal information such as current address and date of birth but much more detailed data too like previous illnesses and operations, blood type, allergies and prescriptions . The data stored by healthcare organisations is usually confidential and should not be shared by anyone other than the citizen in question. Charity & Community Charities may hold financial information of donors who give money to them, as well as information about the different projects that the donations are funding. Charities such as the British Heart Foundation might have physical addresses on the high street so information may be kept about the shops too. Community organisations like sport centres or religious institutions may hold information on members and matches, meetings or events . Comparison of Locations The location of systems and data affects access speed and network quality . ​ The digital divide is the gap between people who do and do not have easy access to computers and networks . Developed vs. Developing Countries Developed countries , like areas of Western Europe, North America and East Asia, have a more developed technology and industry base with more funding available for information infrastructures such as cabling and high-speed access . ​ Developing countries , like areas of Africa and Central Asia, have unstable governments and slower access (if any) to the internet . Less money is spent on technology and improving broadband speed and expensive equipment like computers cannot be purchased on low wages . Urban vs. Rural Urban locations like towns and cities have a high population density . Because there are so many people, councils and IT companies will spend a lot of money on internet infrastructure such as cabling and installing high-speed lines . ​ In Rural locations like the countryside, the population is sparse and settlements may be far apart so internet access is poorer and broadband speeds are slower . This means accessing information on the internet is more difficult . Internet Access from Remote Locations Remote locations (such as the countryside or difficult-to-reach areas like mountains or deserts) might have limited internet access . Fast fixed broadband is expensive to install and many providers simply won't invest in rural areas as it is not economically viable . Some areas, usually those with a very small or temporary population, might have no fixed internet access which will make it difficult for an individual or organisation to communicate or work online. Many remote locations have some form of internet but download speeds will be slow or interrupted due to intermittent connection . This makes it difficult to work online and could take a long time to access webpages or document stores. ​ Alternatives to fixed broadband in remote locations include mobile broadband and satellite broadband . Mobile broadband is generally not designed for home use and would be very expensive for everyday use , plus the remote location will generally mean mobile coverage could also be weak . Satellite broadband requires a dish with an unrestricted view of the sky. Satellite broadband has a relatively high internet speed but will cost a lot to install and has a high latency (more chance of experiencing lag). Q uesto's Q uestions 1.1 - Holders of Information: ​ 1a. State the 7 categories of information holders . [7 ] 1b. For each of the 7 categories , briefly describe 3 different pieces of information that may be stored by the information holder. For example, a charity may store the financial information of donors. [3 each ] ​ 2. What is the digital divide ? [2 ] ​ 3. Describe the differences in information access for the following locations : a. Developed vs. developing countries b. Urban vs. rural areas c. Remote locations [4 each ] Topic List 1.2 - Storage Media

  • Algorithms | CSNewbs

    Algorithms Pseudocode Pseudocode Pseudocode is not a specific programming language but a more general method of describing instructions . It should be unambiguous, and it should not resemble any particular kind of programming language (e.g. Python or Java), so it can theoretically be turned into real code in any language. ​ Generally, pseudocode can be written in any way that is readable and clearly shows its purpose. However, the Eduqas exam board advises that pseudocode for the programming exam should follow the conventions below : Annotation { Write your comment in curly brackets} ​ Define data type price is integer firstname is string ​ Declare a variable's value set price = 100 set firstname = "Marcella" ​ Input / output output "Please enter your first name" input firstname Selection (must have indentation) if firstname = "Steven" then​ output "Hello" + firstname elif firstname = "Steve" then output "Please use full name" else output "Who are you?" end if ​ Iteration (while loop) while firstname ! = "Steven" output "Guess my name." input firstname repeat Iteration (for loop) for i in range 10 input item next i ​ Define a subroutine Declare Sub1 [Subroutine content indented] End Sub1 ​ Call a subroutine call Sub1 Flowcharts flowchart A flowchart can be used to visually represent an algorithm. The flowchart symbols are: Algorithm Example example Pseudocode {This is a program to see how many items you can buy in a supermarket before you spend over £100} ​ total is integer, itemsentered is integer, itemprice is integer set total = 0 set itemsentered = 0 ​ while total < 100 output "enter the price of the next item" input itemprice total = total + itemprice itemsentered = itemsentered + 1 repeat if itemsentered >= 20 then output "You are on your way to saving money." elif itemsentered => 30 then output "You're a real money saver." else output "Look for better deals next time." end if Stop Flowchart

bottom of page