top of page

Search CSNewbs

290 results found with an empty search

  • Expansion Cards | Key Stage 3 | CSNewbs

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

  • Greenfoot Guide #1 | World Setup | CSNewbs

    Learn how to start a new Greenfoot program and set up the world and actors ready for the next steps in creating a game. Part 1 of the Greenfoot Tutorial for the Eduqas/WJEC GCSE 2016 specification. 1. Setup & Populating the World Greenfoot Tutorial 1. Open Greenfoot This tutorial uses Version 2.4.2 which is the version students are given to use in the WJEC/Eduqas Component 2 exam . Click here for more information and how to download 2.4.2 . If you are using a more recent version the code should still work but the look of the program in the screenshots may be different. In the Component 2 exam of the 2016 WJEC/Eduqas specification you would skip ahead to the New Object Placements stage further down this page as the classes should be set up for you. Watch on YouTube: 2. New Scenario For a new project, click ' Scenario ' and then ' New '. If you are using a more recent version of Greenfoot select ' New Java Scenario '. Save this new project in a suitable location such as a folder named 'Greenfoot' . You may wish to save this project as ' SimpleGame ' or ' ExampleGame '. 3. Setup the MyWorld class The first thing to do is to create a subclass of World called MyWorld which becomes our background object. Right-click on the World class and select 'New subclass... ' Set the New class name to MyWorld . Choose any image from the 'backgrounds ' image category. I have chosen the 'cell.jpg ' image. Click the Compile button in the bottom right of the Greenfoot window to save the program . 4. Create the Main Character class Now to create a new class for the main character. Right-click on the Actor class and select 'New subclass... ' Give the new object an appropriate name and choose a relevant image . I have named my class 'Sheep ' and selected the sheep.png image. 5. Right-click on Actor and create two more classes: Collectable objects to pick up (e.g. my orange) An enemy character to avoid (e.g. my elephant) Don't forget to compile the program. Watch on YouTube: After creating your classes you must move them over to the game world. This is known as populating the world . 1. New Object Placements Right-click on your main character object and select the top option e.g. 'new Sheep()'. Drag your mouse to the world and click to drop it. Complete the following actions: Place 1 main character object. Place 5 collectible objects. Place 2 enemy objects. 2. Save the World Once you have populated your world with objects then right-click anywhere on the background and select 'Save the World '. This saves the positions of each object so that it won't reset every time you start a new game. You can close the MyWorld code that automatically opens when you save the world, we never add any code to this window. Part 2 - Movement (Arrow Keys) >

  • 5.1.2 - Types of Device | F160 | Cambridge Advanced National in Computing AAQ

    Learn about different types computers such a desktops, games consoles, laptops, smart speakers, smart TVs, smartphones, tablets, augmented reality (AR), virtual reality (VR) and mixed reality (MR) devices. Based on Unit F160 (Fundamentals of Application Development) for the OCR Cambridge Advanced National in Computing (H029 / H129) (AAQ - Alternative Academic Qualification). Qualification: Cambridge Advanced National in Computing (AAQ) Unit: F160: Fundamentals of Application Development Certificate: Computing: Application Development (H029 / H129) 5.1.2 - Types of Device Watch on YouTube : Types of Device Applications can be developed for a range of different devices , each type of device having its own characteristics and common uses . The characteristics of popular devices, such as laptop and tablets , may be well known, but ensure you know the difference between augmented reality ( AR ), virtual reality ( VR ) and mixed reality ( MR ) devices. Types of Device Common Devices Desktops are powerful and customisable personal computers designed for use at a desk . Game consoles are designed specifically for playing video games , usually connected to a TV . Laptops are portable computers with a built-in screen and keyboard , suitable for work on the go . Smart speakers are voice-controlled devices that play music , answer questions and can control smart home gadgets . Smart TVs have internet access , interactive features and apps for streaming and browsing . Smartphones have internet , GPS and Bluetooth connectivity , apps and communication functions . Tablets use a touchscreen larger than a phone, they are more portable than a laptop and good for browsing and media . Augmented Reality (AR ) is technology that overlays digital images or information onto the real world . Virtual Reality (VR ) uses a computer-generated 3D environment that fully immerses the user , usually with a headset . Mixed Reality (MR ) is a blend of AR and VR where digital objects interact with the real world in real time . Q uesto's Q uestions 5.1.2 - Types of Device: 1. Explain the difference between the three types of 'reality ' devices . [3 ] 2. Justify which devices a streaming service should consider for an app . [4 ] 3. Describe the characteristics of any devices not covered in your responses to Q1 and Q2 . [ 5 ] The AR app Pokémon Go was so popular when it released in 2016 that within the first 6 months players had walked a combined 8.7 billion kilometres ( 200,000 trips around the Earth ). D id Y ou K now? 5.1.1 - Human-Computer Inter. Topic List 5.2 - Visual Design Considerations

  • OCR CTech IT | Unit 1 | 1.3 - Computer System Types | CSNewbs

    Learn about six different types of computer system including embedded, mainframe and quantum. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 1.3 - Computer System Types Exam Board: OCR Specification: 2016 - Unit 1 Different types of computer system are available to purchase and use, each with their own benefits , drawbacks and typical functions . Desktop A computer suitable for use at an ordinary desk. They are bulky and not so easy to move . Individual components (e.g. graphics card) can be upgraded over time . Desktops are versatile , they allow the user to carry out a range of activities , including document creation, data manipulation, game playing, design and communication facilities for personal or business purposes. Tablet / Laptop A small and portable type of computer. Many modern laptops can also fold back , effectively turning them into a tablet with a screen-based virtual keyboard . They can perform many of the functions of the traditional PC, but the screen size can be restrictive , especially if several documents need to be open at the same time. Because it can be transported through public spaces, loss or theft is more likely. Smartphone Embedded Systems Smartphones can be used to run a range of applications including email, social media, videos and music. However, they can negatively affect social interaction (e.g. by using them and ignoring people around you) and reduce spatial awareness when being used. Security is another issue as they can be easily lost or stolen . Security software for phones is not as secure as other computer systems so sensitive data should not be held on smartphones. An embedded system is when a smaller computer system is installed within a larger device , such as a washing machine, traffic light or car. Embedded systems have a dedicated purpose and often run in real-time . The internet of things (IoT) describes a global network of connected objects that were previously 'dumb', such as smart bulbs, smart plugs and thermostats. Mainframe Mainframes are huge and very powerful computers that are reliable . Mainframes are used to process large amounts of data and can be used to solve scientific and engineering problems that require complex calculations with large datasets (e.g. weather forecasting or scientific simulations). Mainframes are reliable and secure because they have large backup capabilities . Mainframes are very expensive and require teams of experts to oversee them, and so are used only by organisations that need to process very large amounts of data quickly, such as banks and airlines . Quantum These are still experimental and in development . They work with quantum bits ( qubits ), which, unlike binary, are not limited to just two states (0 or 1). Qubits represent atomic particles, which can be in several different states at the same time . A fully working quantum computer would potentially be able to process data and perform calculations millions of times faster than currently available computers. Q uesto's Q uestions 1.3 - Computer System Types: 1. For each type of computer system , make a list of benefits , drawbacks and possible uses . a. Desktop [6 ] b. Tablet / Laptop [6 ] c. Smartphone [6 ] d. Embedded System [6 ] e. Mainframe [6 ] f. Quantum Computer [6 ] 2. Suggest and justify which type of computer system is most suitable for the following scenarios: a. Updating a spreadsheet while on a train. [3 ] b. Forecasting the next week’s weather. [3 ] c. A PE teacher recording sports day race times. [3 ] d. Playing a new video game on maximum settings. [3 ] 1.2 - Computer Components Topic List 1.4 - Connectivity

  • HTML Guide 7 - Head Tags | CSNewbs

    Learn about the tags in the head section of an HTML document including the title and meta tags. 7. Head Tags HTML Guide Watch on YouTube: Remember that all HMTL documents are split into the head and the body. The following tags must be typed inside of your head tags . title Title The title is not the main heading. The title is the page title itself that you can see at the tab at the top of your web browser. Add a title to your web page. metadata Metadata Metadata is information about the web page itself. This commonly includes data about the author, the page's contents and any keywords. Metadata will not appear on the actual web page . Add meta data tags between your head tags for author, keywords and a description. The meta tag is made up of a name and content . Author represents who created the web page. Keywords are commonly used words. Description is used for displaying search engine results (such as a Google search). Next it is time to embed YouTube videos into your web page. 6. Organisation Tags HTML Guide 8. Videos

  • 2.2 - Computational Methods | OCR A-Level | CSNewbs

    Learn about computational methods including problem recognition, decomposition, divide and conquer, abstraction, backtracking, data mining, heuristics, performance modelling, pipelining and visualisation. Based on the OCR H446 Computer Science A-Level specification. Exam Board: OCR A-Level Specification: Computer Science H446 3.1f - Standard Algorithms Watch on YouTube : Bubble sort Merge sort Insertion sort Quick sort Linear search Binary search Djisktra's algorithm A* algorithm ? Bubble Sort This page is under active development. Check here for the latest progress update. ? YouTube video uploading soon Merge Sort ? YouTube video uploading soon Insertion Sort ? YouTube video uploading soon Quick Sort ? YouTube video uploading soon Linear Search ? YouTube video uploading soon Binary Search ? YouTube video uploading soon Dijkstra's Algorithm ? YouTube video uploading soon A* Algorithm ? YouTube video uploading soon Q uesto's K ey T erms Standard Algorithms: ? D id Y ou K now? ? 3.1e - Data Structure Algorithms A-Level Topics

  • Python | Section 9 Practice Tasks | CSNewbs

    Test your understanding of string and number handling techniques in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python - Section 9 Practice Tasks Task One It is the national hockey championships and you need to write the program for the TV channel showing the live games. Let the user enter the name of the first country that is playing. Then let the user enter the name of the second country . Shorten country 1 to the first two letters . Shorten country 2 to the first two letters . Bonus: Display the teams in uppercase . Example solution: Welcome to the National Hockey Championships!!! Enter the first country: Montenegro Enter the second country: Kazakhstan Scoreboard: MO vs KA G Task Two In some places, the letter G is seen as an offensive letter. The government want you to create a program to count how many times the letter G appears in a sentence . Let the user input any sentence that they like. You need to count how many g’s there are. Then print the number of g’s there are. Example solution: Enter your sentence: good day! great golly gosh, got a good feeling! There were 7 instances of that awful letter! Task Three A pet shop has just ordered in a batch of new dog collars with name tags. However, there was a mistake with the order and the tags are too small to display names longer than 6 characters . You need to create a program that checks the user’s dog name can fit. Let the user enter their dog’s name . Calculate the length of their name. Use an if statement to see if it is greater than 6 characters . If it is then print – Sorry but our dog tags are too small to fit that. Otherwise print – Excellent, we will make this dog tag for you. Example solutions: Welcome to 'Dogs and Cats' Pet Shop! What is the name of your dog? Miles Excellent, we will make this dog tag for you! Welcome to 'Dogs and Cats' Pet Shop! What is the name of your dog? Sebastian Sorry, our dog tags are too small! Task Four It’s literacy week and the Head of English would like you to create a vowel checker program to ensure that year 7s are using plenty of vowels in their work. Let the user enter any sentence they like. For each letter in the sentence that they have just entered you need to use if statements to check if it is a vowel . You will need to use the OR operator between each statement to separate them. After the for loop you need to print the number of vowels they have used. Example solution: Enter your sentence: Put that thing back where it came from, or so help me! You used 14 vowels in your sentence. Task Five Remember the national hockey championships? Well, the company that hired you just fired you… Never mind though, a rival scoreboard company want to hire you right away. You need to let the user enter two countries like last time. But this time you don’t want to calculate the first two letters, you want to print the last three letters . Example solution: Welcome back to the National Hockey Championships!!! Enter the first country: Montenegro Enter the second country: Kazakhstan Scoreboard: GRO vs TAN Task Six Too many people are using inappropriate names on Instagram so they have decided to scrap the username and will give you a code instead. The code is the 2nd and 3rd letters of your first name , your favourite colour and then the middle two numbers of the year you were born . Let the user input their name, then their favourite colour and then the year they were born. Using their data, calculate their new Instagram name! Example solution: Welcome to Instagram What is your name? Matthew What is your favourite colour? red Which year were you born in? 1987 Your new profile name is: ATRED98 Task Seven Copy the text on the right and create a program that will split the text at each full stop. Count the number of names in the list. Print the longest name. Example solution: The list contains 20 names The longest name is alexandria annabelle.clara.damien.sarah.chloe.jacques.mohammed.steven.rishi.raymond.freya.timothy.claire.steve.alexandria.alice.matthew.harriet.michael.taylor ⬅ 9b - Number Handling 10a - Open & Write To Files ➡

  • Python | Section 4 Practice Tasks | CSNewbs

    Test your understanding of selection (if statements) and operators (mathematical and logical). Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python - Section 4 Practice Tasks Task One: Spanish Numbers Create a very simple Spanish translation program. Let the user enter a number between one and four then print the Spanish word for that number using if , three elif s and else . One in Spanish is uno , two is dos , three is tres and four is cuatro . If they enter anything else print “I only know 1 to 4 in Spanish!” . Example solutions: Enter a number between 1 and 4: 3 tres Enter a number between 1 and 4: 5 I only know 1 to 4 in Spanish! Task Two: School Trip A school is organising a trip to Alton Towers . The coaches they are hiring can fit 45 people . Enter the total number of people going on the trip and work out how many coaches will be full (using integer division ) and how many people will be left over on a partly full coach (using modulo division ). Example solutions: How many people are going on the trip? 100 There will be 2 full coaches and 10 people on another coach. How many people are going on the trip? 212 There will be 4 full coaches and 32 people on another coach. Task Three: Driving Tractors There are different rules in the United Kingdom for what farmers at certain ages can drive . Ask the user to input their age and then output the relevant information below: Children under 13 cannot drive any tractors. A trained and supervised 13 to 15 year old can drive a low-powered tractor on private flat grass. 16 year olds with a provisional category F licence can drive tractors less than 2.45 metres wide. Young adults from 17 to 20 with the correct licence and training c an drive tracked vehicles that weigh less than 3,500kg. Adults over 21 years old , with the correct licence and training, can drive all types of tractor. Note: Always be safe around machinery in farms regardless of your age. Driving without adequate training and a licence is illegal. Example solutions: How old are you? 8 You cannot drive any type of tractor. How old are you? 13 If you are trained and supervised you can drive a low-powered tractor on private flat grass. How old are you? 19 With the correct licence and training you can drive tracked vehicles that weigh less than 3,500kg. Task Four: Avoid the Three Choose a category like planets , people in your class or months of the year. Secretly choose three of them . Ask the user to enter a word in your category. If they enter one of the three that you chose, they lose . Example solutions: I have secretly selected three months you must avoid! Enter a month of the year: April AHA! You chose one of the secret months, you lose! I have secretly selected three months you must avoid! Enter a month of the year: December Well done, you didn't choose one of my three! ⬅ 4c - Logical Opera tors 5a - Random ➡

  • 1.4 - Secondary Storage - Eduqas GCSE (2020 spec) | CSNewbs

    Learn about the four types of secondary storage - magnetic, optical, solid-state and cloud. Also, learn about the data storage units from bit to yottabyte. Based on the 2020 Eduqas (WJEC) GCSE specification. 1.4: Secondary Storage & Data Units Exam Board: Eduqas / WJEC Specification: 2020 + Secondary storage (also known as backing storage ) is non-volatile storage used to save and store data that can be accessed repeatedly. Secondary storage is not directly embedded on the motherboard (and possibly even external ) and therefore further away from the CPU so it is slower to access then primary storage . Storage Characteristics: CAPACITY : The maximum amount of data that can be stored. DURABILITY : The physical strength of the device, to withstand damage. PORTABILITY : How easy it is to carry the device around. ACCESS SPEED : How quickly data on the device can be read or edited . COST : The average price it costs to purchase a storage device. Magnetic Storage Optical Storage A magnetic hard disk drive (HDD ) is the most common form of secondary storage within desktop computers. A read/write head moves nanometres above the disk platter and uses the magnetic field of the platter to read or edit data. An obsolete (no longer used) type of magnetic storage is a floppy disk but these have been replaced by solid state devices such as USB sticks which are much faster and have a much higher capacity. Another type of magnetic storage that is still used is magnetic tape . Magnetic tape has a high storage capacity but data has to be accessed in order (serial access ) so it is generally only used by companies to back up or archive large amounts of data . Optical storage uses a laser to project beams of light onto a spinning disc, allowing it to read data from a CD , DVD or Blu-Ray . This makes optical storage the slowest of the four types of secondary storage. Disc drives are traditionally internal but external disc drives can be bought for devices like laptops. Magnetic Storage Characteristics: ✓ - Large CAPACITY and cheaper COST per gigabyte than solid state . X - Not DURABLE and not very PORTABLE when powered on because moving it can damage the device. X - Slow ACCESS SPEED but faster than optical storage . Optical Storage Characteristics: X - Low CAPACITY : 700 MB (CD ), 4.7 GB (DVD ), 25 GB (Blu-ray ). X - Not DURABLE because discs are very fragile and can break or scratch easily. ✓ - Discs are thin and very PORTABLE . Also very cheap to buy in bulk. X - Optical discs have the Slowest ACCESS SPEED . Magnetic Disks are spelled with a k and Optical Discs have a c. Solid State Storage Cloud Storage There are no moving parts in solid state storage. SSD s (Solid State Drives ) are replacing magnetic HDDs (Hard DIsk Drives) in modern computers and video game consoles because they are generally quieter , faster and use less power . A USB flash drive ( USB stick ) is another type of solid state storage that is used to transport files easily because of its small size. Memory cards , like the SD card in a digital camera or a Micro SD card in a smartphone , are another example of solid state storage. When you store data in 'the cloud', using services such as Google Drive or Dropbox, your data is stored on large servers owned by the hosting company . The hosting company (such as Google) is responsible for keeping the servers running and making your data accessible on the internet . Cloud storage is very convenient as it allows people to work on a file at the same time and it can be accessed from different devices. However, if the internet connection fails , or the servers are attacked then the data could become inaccessible . Solid State Characteristics: X - High CAPACITY but more expensive COST per gigabyte than magnetic . ✓ - Usually DURABLE but cheap USB sticks can snap or break . ✓ - The small size of USB sticks and memory cards mean they are very PORTABLE and can fit easily in a bag or pocket. ✓ - Solid State storage has the fastest ACCESS SPEED because they contain no moving parts . Cloud Storage Characteristics: ✓ - Huge CAPACITY and you can upgrade your subscription if you need more storage. ✓ / X - Cloud storage is difficult to rank in terms of PORTABILITY , DURABILITY and ACCESS SPEED because it depends on your internet connection. A fast connection would mean that cloud storage is very portable (can be accessed on a smartphone or tablet) but a poor connection would make access difficult . ✓ - Cloud storage is typically free for a certain amount of storage. Users can then buy a subscription to cover their needs - Dropbox allows 2 GB for free or 2 TB for £9.99 a month. Data Storage Units 0 / 1 All data in a computer system is made up of bits . A single bit is a 0 or a 1 . 4 bits (such as 0101 or 1101) is called a nibble . 1,024 bytes is called a kilobyte . A kilobyte can store a short email . A 8 bits is called a byte . A byte can store a single character . 1,024 kilobytes is called a megabyte . A megabyte can store about a minute of music . 1,024 megabytes is called a gigabyte . A gigabyte can store about 500 photos . 1,024 terabytes is called a petabyte . A petabyte can store about 1.5 million CDs . 1,024 gigabytes is called a terabyte . A terabyte can store about 500 hours of films . More data storage units: 1,024 petabytes is called a exabyte . 1,024 exabytes is called a zettabyte . 1,024 zettabytes is called a yottabyte . Q uesto's Q uestions 1.4 - Secondary Storage: 1. Rank magnetic , optical and solid-state storage in terms of capacity , durability , portability , speed and cost . For example, magnetic has the highest capacity , then solid-state, then optical. This could be completed in a table . [15 ] 2. Justify which secondary storage should be used in each scenario and why it is the most appropriate: a. Sending videos and pictures to family in Australia through the post . [ 2 ] b. Storing a presentation to take into school . [ 2 ] c. Storing project files with other members of a group to work on together . [ 2 ] d. Backing up an old computer with thousands of files to a storage device. [ 2 ] 3. Put the following data storage units in order from smallest to largest : a . kilobyte - gigabyte - byte - megabyte - nibble - bit [3 ] b. gigabyte - petabyte - kilobyte - exabyte - terabyte - megabyte [ 3 ] 1.3 - Primary Storage 1.5 - Performance Theory Topics

  • Python | 5e - More Libraries | CSNewbs

    Learn how to use the math library and to refresh the screen (on some editors only). Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 5e - More Libraries Clear Screen Importing the os library and using the .system() command with the "clear" parameter will clear the screen . The console won't clear on offline editors like IDLE but will work with many online editors like Replit. import os print ( "Hello" ) os. system ( "clear" ) print ( "Bye" ) Bye Clear Screen Task ( Trivia Questions ) Ask three trivia questions of your choice to the user and clear the screen between each one. You should display the total they got correct after the third question - to do this you need to set a variable called correct to equal 0 at the start and then add 1 to correct each time a correct answer is given . Example solution: The Math Library The math libraries contains several commands used for numbers: sqrt to find the square root of a number. ceil to round a decimal up to the nearest whole number and floor to round down to the nearest whole number. pi to generate the value of pi (π ). The sqrt command will find the square root of a number or variable placed in the brackets and return it as a decimal number . from math import sqrt answer = sqrt(64) print (answer) 8.0 The ceil command rounds a decimal up to the nearest integer and the floor command rounds a decimal down to the nearest integer . from math import ceil, floor answer = 65 / 8 print ( "True answer:" , answer) print ( "Rounded up:" , ceil(answer)) print ( "Rounded down:" , floor(answer)) True answer: 8.125 Rounded up: 9 Rounded down: 8 The pi command generates a pi value accurate to 15 decimal places . Pi is used for many mathematical calculations involving circles . The area of a circle is pi x radius² . The first example below uses 5.6 as the radius . from math import pi radius = 5.6 area = pi * (radius * radius) print ( "The area of the circle is" , area) The area of the circle is 98.5203456165759 The example below uses an input to allow the user to enter a decimal (float ) number for the radius. It also uses the ceil command to round the area up . from math import pi, ceil radius = float(input( " Enter the radius: " )) area = pi * (radius * radius) print ( "The area of the circle is" , ceil(area)) Enter the radius: 2.3 The area is 17 Clear Screen Task ( Area of a Sph ere ) The formula of a sphere is 4 x π x r² where π represents pi and r is the radius . Use an input line to enter the radius and then calculate the area of the sphere . Round the answer down to the nearest integer using floor and print it. Example solution: Enter the radius: 7.1 The area of the sphere is 633 ⬅ 5d - Coloram a Section 5 Practice Tasks ➡

  • Python | 7a - Procedures | CSNewbs

    Learn how to create and use procedures in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 7a - Procedures Subroutines A subroutine is a section of code that can be re-used several times in the same program. It is separate from the main code and has to be ‘called’ upon. Subroutines are designed to be repeated, and they have three key benefits: Subroutines make programs easier to read . They reduce the duplication of code . Complex problems are broken down into smaller chunks . There are two types of subroutines: procedures and functions . A procedure just executes commands , such as printing something a certain number of times. A function produces information by receiving data from the main program and returning a value to the main program. For example, a function could take the radius of a sphere from the main program, calculate a sphere’s area and return the value of the area to the main program. A function generally requires parameters to work – these are the values to be transferred from the main program to the subroutine. Procedures A procedure i s a type of subroutine that runs independently of the main program . A subroutine must be defined at the top of the program before the main code by typing def and the name of the subroutine . In the example below I have created a procedure to calculate the multiplication of two numbers and a separate procedure for the division. The main program starts beneath the subroutines , against the left side of the editor. I have created a while true loop that asks the user if they want to multiply, divide or stop the program. If they choose to multiply, the multiply subroutine is called . This initiates that subroutine then returns to the main program when it is complete. If they choose to divide, the divide subroutine is called instead. Typing stop will break (end) the loop. Here you can see the two parts of the program put together. Subroutines must be written first , with the rest of the program underneath. Subroutines can be called in any order . Below I have run the program and divided then multiplied before breaking the loop: Practice Tasks 1 1. Create a procedure called hello that just prints “Hello there! ”. In the main program create a for loop that calls the procedure 10 times. You must use a procedure. 2. Create a program with two procedures. The addition procedure allows the user to add two numbers together. The subtraction procedure allows the user to take a number away from another. Use a while true loop in the main program and a break to stop the loop. Example solution for #1: Local & Global Variables Programming languages use local variables and global variables . A global variable can be used anywhere in the program . A local variable can only be used in the subroutine it is created in . I have adapted the multiply / divide program below to use global variables by stating the global command and the name of the variables in each subroutine. This allows me to ask the user to enter numbers in the main program. Practice Tasks 2 1. Adapt your addition / subtraction program from the first practice task section to use global variables. 2. Create a program that asks the user to enter their name in the main program. Call a subroutine that greets the user using the name variables. You must use a procedure and a global variable . Example solution for #2: ⬅ Section 6 Practice Tasks 7b - Functions ➡

  • Greenfoot Guide #7 | Extension Ideas | CSNewbs

    Consider multiple extensions to increase the complexity of your Greenfoot game. Part 7 of the Greenfoot Tutorial for the Eduqas / WJEC GCSE 2016 specification. 7. Extension Ideas Greenfoot Tutorial This concludes the tutorial for a simple Greenfoot game! Try a combination of the suggestions below to add complexity to your game: 1. Make a New Class for 'Bad' Collectibles Create a new subclass in the Actor classes section for a new collectible that will lower the score if picked up. Add code to your main character to remove the collectible when they touch . Add code to decrease the counter by 1 at the same time. 2. Make the Collectibles Move Randomly Copy the code from your enemy class that makes it move randomly and bounce on edge , and paste this into your collectible class . This makes it harder to catch the collectables, especially if there are 'bad' objects to avoid. 3. Stop the Game Go to the code of your enemy and add the line underlined in red within your removal code. This will stop the game if your main character is eaten. 4. Make the Game Multiplayer Create a new subclass in the Actor classes section for a new main character that will be controlled by a second player . Add code to your new character to move it right, down, left and up . Choose different keys for each direction , such as the WASD keys or IJKL keys. If the second player touches a collectible , add code to decrease the score . Multiplayer Rules: Player 1 wins if the final score is above 0 . Player 2 wins if the final score is negative . It is a draw if it finishes on 0 . < Part 6 - The Counter

© CSNewbs 2025

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