Search CSNewbs
290 results found with an empty search
- OCR CTech IT | Unit 1 | 4.5 - Job Roles | CSNewbs
Learn about the different skills and attributes that are required for IT roles including a network manager, programmer, animator and technician. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 4.5 - Job Roles Exam Board: OCR Specification: 2016 - Unit 1 There are several different IT-related roles within most companies. Each role requires specific skills and attributes to be performed successfully. Try to apply the most suitable personal attributes that were described in 4.3 , as well as any other important skills relevant to the role , such as programming. Self-motivation Leadership Respect Dependability Punctuality Problem Solving Determination Independence Time Management Team Working Numerical Skills Verbal Skills Planning & Organisation Network Manager A network manager must control a group of employees with strong leadership to clearly set out their vision for the team. They must be able to motivate and encourage the team members to meet objectives . Because a network manager is high-ranking, there may not be many senior staff above them so they must be self-motivated and able to complete tasks independently , without being monitored . Network managers must be dependable and decisive , able to weigh up the consequences of a decision and make tough calls whilst under pressure . Time management is an important attribute for a network manager, they must be able to prioritise tasks and ensure deadlines are kept to . IT Technician IT technicians must have good interpersonal skills so that they can communicate clearly with other employees or customers. They should be able to use simplified terminology to help another person with their problem. They must be able to use questioning effectively to work out what the issue is to begin to solve it. IT technicians should have plenty of experience with hardware and software troubleshooting and be able to use a range of troubleshooting tools to solve a problem. They need to be respectful to customers and employees when solving a problem and show determination , as well as self-motivation , to fix issues within acceptable time limits . Programmer A programmer needs to be competent in specific programming languages that the company use. It would be beneficial to have knowledge of more than one programming language so they can be more versatile and approach a problem in different ways . Programmers need to have a logical mind so that they are able to creatively solve problems. Using computational thinking is an important set of skills that programmers should have - for example, by using decomposition to break a large problem into smaller, more manageable chunks. They must have good planning and organisational skills so that they can stay on top of the numerous tasks that need to be done. They need good time management skills to prioritise the more important tasks and stick to a deadline . Programmers must be patient individuals, all programs will contain errors that must be debugged and rewritten numerous times. Good interpersonal skills are necessary so programmers can work efficiently in teams - often multiple programmers will work on subsections of the same program that fit together later. Web Designer & Animator Web designers create , plan and code web pages to fit specific requirements made by their customers. They must create both the technical and graphical aspects of the web page, editing both how it looks and how it works. Web designers could also be responsible for maintaining a site that currently exists. They would need to have sufficient knowledge of using HTML (HyperText Markup Language ) for the structure and content of the webpage and CSS (Cascading Style Sheets ) for the formatting and style . An animator may use a mixture of digital and hand-drawn images or even puppets and models. The main skill of animation is still artistic ability , but there is an ever-increasing need for animators to be experienced with technical computer software . Animators usually work as part of a team with strict deadlines . Q uesto's Q uestions 4.5 - Job Roles: 1. Describe the key skills and personal attributes that a new programmer should have. [10 ] 2. A brief job description of a web designer and an animator are shown above on this page. Use the descriptions of what makes a suitable network manager, IT technician and programmer to help you explain which personal attributes and skills are required for: a) A web designer b) An animator [8 each ] 4.4 - Ready for Work Topic List 4.6 & 4.7 - Bodies & Certification
- Python | 1c - Creating Variables | CSNewbs
Learn how to create variables in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 1c - Creating Variables What is a Variable? A variable represents a value that can change as a program is running . The two parts of a variable are the name (e.g. sweets) and the value (e.g. 8). sweets = 8 print (sweets) = 8 amount of sweets = 8 8sweets = 8 sweets A variable can't contain spaces , it must start with a letter , and you must declare its value before you can use or print it. You always need to print the variable name (e.g. biscuits), not the value (20) as the value can change. Important – When writing variable names, we do not need speech marks. (e.g. type biscuits , not “biscuits”) We use variables because the value of something might change as the program is executed. For example, if someone eats a sweet then the value of our variable changes: sweets = 8 print (sweets) sweets = 7 print (sweets) = 8 7 sweets = 8 print ( Sweets) You must be consistent with capital letters when writing variable names. sweets and Sweets are treated as two different variables. Creating Variables Task 1 ( Age & Pets) Make a variable named age and set it to your current age. On the next line print age . Make another variable named pets and set it to how many pets you have. On the next line print pets . Example solution: 14 2 Variables with Strings (Text) In programming, a collection of alphanumeric characters (letters, numbers and punctuation) is called a string . "Pikachu" is a string. In the example below, pokemon is the variable name that represents the variable value "Pikachu" . pokemon = "Pikachu" print (pokemon) = Pikachu To create a string, we use "speech marks" . Numbers by themselves and variable names do not use speech marks. Each variable can only have one value at a time, but it can change throughout the program. pokemon = "Pikachu" print (pokemon) pokemon = "Squirtle" print (pokemon) = Pikachu Squirtle Creating Variables Task 2 ( Superhero & Colour ) Make a variable named superhero and set it to any of your choice, such as "Spider-Man" . Print the superhero variable on the next line. Make another variable named colour and set it to the colour related to your chosen superhero. Print the colour variable on the next line. Example solutions: Spider-Man Red The Hulk Green ⬅ 1b - Co mmenting 1d - Using Variables ➡
- Python | 12 - Error Handling | CSNewbs
Learn how to handle errors in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. Python 12 - Error Handling Errors When an error occurs in Python, you may see a chunk of red text like this. This is very useful when creating programs as it tells us the exact line of the error (10), and its type (NameError). However, a completed program should have code in place for when an unexpected error occurs – we call this exception handling . General Exception In this example, Python will attempt to run the code indented beneath try . If there are no errors then the code will stop just before except . If an error does occur then the Exception code will be run . If we enter a correct value then the program will execute normally: But if an error occurs (such as writing a string when an integer is expected) then the Exception code will run : You can add the else command to your code that will execute only if there are no errors : If a valid number is entered then the else code will be printed: If a code generating an error is entered then the except code will be printed: Practice Task 1 Create a program that asks the user to input their age. Don't forget to use the int command. Use try and except to print a message if a number is not inputted. Example solution: Specific Exceptions The Exception command used in the section above is for any general error that occurs. You can also use specific except commands for a variety of errors. Below is a program with two different specific exception commands for one try statement: If a Value Error occurs, such as when the wrong data type is entered , then related code will be printed: Or if the user tries to divide by zero then a Zero Division Error will be triggered which prints a relevant response: Other types of exception can be found here . Practice Task 2 Create a program that asks the user to input a number and then divides this value by 999. Create a Value Error and Zero Division Error exception and include an appropriate message in both. Example solution for Zero Division: ⬅ 11 - Graphical User Interfac e Extended Task 1 (Pork Pies) ➡
- 2.3 - Software Development Methodologies | OCR A-Level | CSNewbs
Based on the OCR Computer Science A-Level 2015 specification. Exam Board: OCR 2.3: Software Development Methodologies 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.3 - Software Development Methodologies: 1. What is cache memory ? [ 2 ] 2.2b - Translators & Compilation Theory Topics 2.4a - Programming & Pseudocode
- OCR CTech IT | Unit 1 | 1.2 - Computer Components | CSNewbs
Learn about required internal hardware including the CPU, motherboard and PSU. Find out about ports and expansion cards. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification. 1.2 Computer Components Exam Board: OCR Specification: 2016 - Unit 1 This page describe the various components inside of computer systems . The first three are necessary in every type of computer: Processor Motherboard Power Supply Unit The main role of a processor is to manage the functions of a computer system by processing data and instructions . The primary processor of each computer system is the Central Processing Unit ( CPU ). A processor is attached to the motherboard using a connection point called a CPU socket . The motherboard is the main circuit board of a computer on which components such as the CPU and ROM are connected . The motherboard contains PCI slots for expansion cards and ports for external devices to be connected . The power supply unit (PSU ) converts electricity from AC (Alternating Current) from the mains power supply to DC (Direct Current) which the computer system can use . The PSU of desktop computers is internal whereas portable devices require an external 'charger '. Memory Computer memory is split into two types - volatile and non-volatile . Volatile storage is temporary (data is lost whenever the power is turned off ). Non-volatile storage saves the data even when not being powered , so it can be accessed when the computer is next on and can be stored long-term . Random Access Memory (RAM) Read-Only Memory (ROM) Cache Memory RAM is volatile (temporary) storage that stores all programs that are currently running . RAM also stores parts of the operating system to be accessed by the CPU. RAM is made up of a large number of storage locations, each can be identified by a unique address . ROM is non-volatile storage that cannot be changed . ROM stores the boot program / BIOS for when the computer is switched on. The BIOS then loads up the operating system to take over managing the computer. Cache memory is volatile (temporary) storage that stores frequently accessed data . It is very quick to access and faster than other types of memory like RAM because it is stored on the processor itself. RAM ( R andom A ccess M emory) ROM ( R ead O nly M emory) Cache Memory Secondary Storage Magnetic Storage 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 . X - Optical discs have the Slowest ACCESS SPEED . Magnetic Disks are spelled with a k and Optical Discs have a c. Magnetic Storage Characteristics: ✓ - Large CAPACITY and cheaper per gigabyte than solid state . X - Not DURABLE and not very PORTABLE when powered on because moving it can damage the device. ✓ - Relatively quick ACCESS SPEED but slower than Solid State . 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. A magnetic hard disk drive (HDD ) is a 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. Hard disk drives can also be external and connected through a USB port . 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 . Solid State Storage Cloud Storage When you store data in 'the cloud ', using services such as Google Drive, 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 typically free for a certain amount of storage and users can buy more storage space when they need it - the scalable nature of this storage type makes it very flexible for businesses. 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 . Cloud storage is also known as 'virtual storage ' because the data is saved remotely , freeing up physical storage space for users on their own devices . 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. Solid State Characteristics: X - High CAPACITY but more expensive 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 . Storage Protocols SCSI ( Small Computer System Interface ) is a protocol (set of rules) for attaching external devices to a computer system, such as a printer, storage drive or scanner. SAS ( Serial Attached SCSI ) is an improved version of SCSI that enables many more external devices (up to 128) to be connected at the same time to a computer system. Expansion Cards Expansion cards are dedicated circuit boards with a specific purpose that are attached to the motherboard . Most of the following expansion cards can also exist as integrated components on the motherboard, rather than a separate card. Graphics Card Sound Card Processes graphical data (e.g. videos or animations) and converts it into a displayable output on a monitor . Network Interface Card (NIC) 0010 1011 0101 0101 0110 0111 0101 0001 0101 Sound cards convert analogue sound waves into digital data (binary) when inputting audio through a microphone. Sound cards also convert digital data (binary) into analogue sound waves to output audio through speakers or headphones. 0010 1011 0101 0101 0110 0111 0101 0001 0101 Allows computers to connect to networks (such as the Internet ) and enables them to transfer data to other computers. Transfers data between servers across a network. Fibre channel allows for quick transfer speeds and is primarily used to connect data storage to servers in large data centres. Fibre Channel Card Storage Controller Card Required for the computer to manage and use any attached storage devices . Ports A port is the interface between external devices and the computer . Ports allow data to be transferred from and to these devices. USB Port Connects storage devices such as USB sticks or external hard drives . Connects input devices such as a keyboard or mouse, as well as other devices for data transfer such as a camera or smartphone. Ethernet Port Connects computers to network devices such as a modem or router, allowing access to the internet . FireWire Port Developed for Apple products, FireWire transfers data at a high speed from devices such as camcorders and external hard drives . FireWire supports isochronous devices , meaning data is sent in a steady , continuous stream . SATA Port Allows fast data transfer to external HDD , SSD or optical drives . SD Port Enables data from an SD card to be transferred from a device like a camera to the computer. Micro SD Port Allows data from a micro SD card to be transferred from devices such as smartphones , tablets and handheld games consoles to a computer. Q uesto's Q uestions 1.2 - Computer Components: Vital Components: 1. Describe the purpose of the following components : a. The CPU (Central Processing Unit ) [2 ] b. The motherboard [2 ] c. The PSU (Power Supply Unit ) [2 ] Primary Memory: 2a. What is the difference between primary and secondary memory ? [2 ] 2b. What is the difference between volatile and non-volatile storage ? [2 ] 2c. For each of the three types of primary memory , describe its role and give an example of what it can store. [6 ] Secondary Storage: 3a. For magnetic , optical and solid-state storage rank these three secondary storage mediums in terms of capacity , durability , portability and speed . [9 ] 3b. For the following scenarios justify which secondary storage medium should be used and why it is the most appropriate : Sending videos and pictures to family in Australia through the post. [3 ] Storing a presentation to take into work. [3 ] Storing project files with other members of a group to work on together. [3 ] Backing up an old computer with thousands of file to a storage device. [3 ] Additional Components: 4a. State the purpose of five different expansion cards . [5 ] 4b. What is the purpose of the motherboard ? [2 ] Ports: 5a. Describe the six different ports . [6 ] 5b. What is the difference between SCSI and SAS ? [2 ] 1.1 - Computer Hardware Topic List 1.3 - Computer System Types
- 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
- Download Greenfoot | CSNewbs
A tutorial to understand how to create a game in Greenfoot. A simple step-by-step guide and walkthrough featuring all code needed for the Eduqas GCSE 2016 specification. Installing Greenfoot Greenfoot Home According to the Eduqas 2016 specification exam students will use version 2.4.2 of Greenfoot in the Component 2 exam . Eduqas GCSE students should practice using version 2.4.2 - despite the most up-to-date version currently being 3.6.1. If you are not learning Greenfoot for the Eduqas GCSE then you may wish to download and use the most current version. Eduqas 2016 Specification Students Other Students The version used in the Component 2 exam is 'Greenfoot version 2.4.2 '. Scroll down to 2.4.2 on the old download page and select the correct version for your computer. Windows systems should use the 'For Windows ' option. If you are not following the Eduqas 2016 specification then you should download the most up-to-date version of Greenfoot. Select the correct version for your computer at the top of the download page .
- 1.7 & 1.8 - Internet Pros & Cons | Unit 2 | OCR Cambridge Technicals | CSNewbs
Learn about the advantages and disadvantages to individuals and organisations when using the internet. Based on the 2016 OCR Cambridge Technicals Level 3 IT specification for Unit 2 (Global Information). 1.7 & 1.8 - Internet Pros & Cons Exam Board: OCR Specification: 2016 - Unit 2 The internet has become easier and cheaper to access since the mid 1990s and today it is almost taken for granted. The rise of the internet, and the services it provides, has lead to advantages and disadvantages for both individuals and organisations . Advantages for Individuals Increased speed of personal communication Allows for instant messaging, emails and video chats across the world. Easy access to information The internet has free resources such as CSNewbs and Wikipedia, plus academic journals for research & study. 24/7 access to services Shopping, browsing and banking can be completed when convenient for the user. Social interaction with others Social media, discussion forums and online games provide entertainment and social interaction. Disadvantages for Individuals Potential for identity theft Uploading personal data and storing sensitive information risks hackers obtaining and utilising it. Cost of connection & services Internet service providers (ISPs) charge a monthly fee and equipment like a router needs installation. Cyberbullying & trolling The abuse of others on social media is possible. Anonymisation makes it harder to catch offenders. Spreading misinformation 'Fake news' or biased information can be easily spread on social media and lead to incorrect assumptions. Source of distraction Staff and students may neglect their work and study for entertainment or social media. Advantages for Organisations Share data quickly globally Files and information can be sent instantly to locations across the world. Cloud storage can store data. Online services always available E-commerce businesses can operate 24/7 globally, permit users to browse and accept payments. Easy internal communication Staff can use emails, video calls or instant messages to communicate. Open up the workplace Staff can work from home, on the commute to/from work and outside of the office. Disadvantages for Organisations Malicious attacks & threats Websites can be hacked / taken offline with DDoS attacks. Data can be stolen or corrupted. Cost of maintaining services Most companies require an IT department to oversee device installation and maintenance. Reputation and controversies Companies that leak data will damage their reputations. Social media posts could backfire. Q uesto's Q uestions 1.7 - Internet Pros & Cons: 1. List 5 points for the following categories (you may need to include researched / your own points for some): a. Advantages of the internet for individuals [5 ] b. Disadvantages of the internet for individuals [5 ] c. Advantages of the internet for organisations [5 ] d. Disadvantages of the internet for organisations [5 ] 1.6 - Information Formats Topic List 2.1 - Information Styles
- App Inventor 2 | Munchin' Pizza | CSNewbs
Learn how to use App Inventor 2 to create simple programs. Try to complete task 3 on this page. Perfect for Key Stage 3 students to experiment with block coding, objects and properties. App Inventor Task 3 - Munchin' Pizza This page will teach you how to make a simple app that changes pictures when a button is pressed . You can make the app more complex by adding sounds or additional buttons. Step 1: Set up App Inventor 2 Open App Inventor 2 (use the button on the right) and create a new project. You will need to log in with a Google account. Download the picture images from the zipped folder on the App Inventor 2 Basics page here . Once you have downloaded the pizza pictures you will need to upload them. Find the Media tab on the right side of App Inventor and click 'Upload File...' You will need to upload each picture individually. In the Palette tab on the left side, drag two buttons into the middle screen so they look like this: In the Components tab on the right, click on Button1 and click the Rename button at the bottom to change it to Pizza . Then Rename Button2 to Munch . This will help us when we code later as it will be less confusing. Click on the second button (Munch) that you just dragged into the centre then look in the Properties tab on the right and scroll down to Text . Change 'Text for Munch' to something like 'Munch Pizza' . Now click on the first button in the centre (Pizza) and in the Properties tab, click on Image and select the first image. It should be the full slice of pizza. When you have set the image, you might notice it goes a bit crazy. Still in the Properties tab, change the Height and Width to 'Fill parent...' for both. This will make the image fit within the boundaries of the screen. Finally, change the Text for the Pizza button to be blank. Otherwise it will appear on top of the pizza and look odd. So far you should have a button disguised as a pizza and another button that tells you to munch that lovely cheesy deliciousness. If your program does not look like this, read the instructions above again carefully. Step 2: Code Click on the Blocks button in the top right to start adding code. In the Blocks tab on the left side click on Munch and drag the when Munch Click block into the centre. This block will execute any code inside of it whenever the munch button is clicked. In the Blocks tab on the left side click on Logic and drag an if then block and snap it inside the block you just dragged over. Click on the blue cog button and drag four else if blocks inside the if block at the bottom. The blocks at the top will automatically update when you drag the blocks under the if block underneath. Because we are using different images, we need to check which image is currently being displayed, so we know which picture to change to. Firstly we want to check if the first image is being displayed. Connect an = block from the Logic section. Then add a Pizza Image block from the Pizza section. Lastly grab a " " block from the Text section and write the name of your first image inside (e.g. pizza1.jpg) Don't forget the extension (.jpg). But what does this code actually mean? It is checking to see what the current pizza image is. And if it is pizza1.jpg then it is going to... ...change the picture to pizza2.jpg, as if someone has munched the pizza! Grab a set Pizza Image to block from Pizza and then snap another " " block from Text and add the pizza2.jpg text inside. Now that we have written the code to check the current picture and move it to the next one when pressed, we just need to copy this for the other four pizza pictures. Rather than select all the blocks again, right-clicking on the blocks and selecting 'Duplicate' will copy them. Copy each block and then change the values so that if pizza2.jpg is the current image, then it sets it to pizza3.jpg and so on. Make sure that pizza5.jpg sets the image to pizza1.jpg so that it goes round in a loop. Program 3 Complete! Step 3: Run The easiest way to run an app that you have created at home using App Inventor 2 is to download the free MIT AI2 Companion App on your smartphone from the Google Play Store . At the top of the App inventor program on your computer , click on Connect and AI Companion . This will generate a six-digit code you can type into your phone. If your school has the emulator installed, you can also use this to test your app. Extra Step: Challenges 1. Create your own images and upload them . You can easily create your own set of pictures and link them together. Why not try: Eating a different type of food (e.g. cookie or doughnut). A simple scene that changes from night to day. A simple character that changes appearance (like Pikachu powering up a thunder strike with each button press). 2. Add a sound effect whenever a button is pressed . In the video at the top of the page, you'll see I have a 'munch' sound whenever the button is pressed. You could record this sound yourself or use a sound effect site. Once you have got your sound file (it should be short and .mp3) you need to upload it, just like you uploaded your images. In the Designer layout click 'Upload file...' in the Media tab on the right. Then look in the Palette tab on the left side, open the Media section and drag a Sound block into the centre. It will appear underneath the phone screen in a section called 'non-visible components' which is fine. Now click on Properties on the right side and choose the sound file you just uploaded in the Source box. Click on the Blocks button in the top right to start adding the code! In the Blocks tab on the left side, click on Sound1 and drag the call Sound1 Play block directly underneath when Munch click . This will play the sound everytime the button is pressed. 3. Add more buttons . You could add a second clickable button which reverses the pattern and a third button that resets the order back to the first image. Adding new buttons is easy - drag them from the Palette tab in the Designer layout. Change the button text in the Properties tab and the name of the button in the Components tab. To add code, click on Blocks in the top right then you can duplicate the code for Munch by right-clicking and choosing Duplicate. Now just change the values to what you want. If you are making a reset button, you don't need an if then statement, just set the image to your first image when the button is clicked. Keep messing around with the program and have fun! KS3 Home Tasks 4, 5 & 6
- Python | 1b - Commenting | CSNewbs
Learn how to comment in Python. Try practice tasks and learn through text and images. Perfect for students learning GCSE Computer Science in UK schools. top Python 1b - Commenting Writing Comments To annotate your work, you can write a comment using the # symbol. Comments are ignored when you run the program and they are not printed . #This is a comment! print ( "Welcome to Python!" ) #The code above prints a nice greeting = Welcome to Python! Programmers use comments to explain to other people (and themselves) what different sections of code do . With massive programs, comments are vital; otherwise, it would be too confusing, especially after returning from a few weeks or months on a different project. If you are creating a Python project for school (or A-Level Computer Science coursework), you will need comments to explain your code and prove you have written it yourself. Comments over Multiple Lines Have a lot to say in one comment? Use three apostrophes ( ”’ ) at the start and three more at the end of your comment like below: '''This is a comment that I have spread out over more than one line''' print ( "Hello! How are you?" ) Top Tip: Use multi-line comments when testing a program to ‘blank out’ sections that you know work fine and only focus on one part at a time. Commenting Task 1 (Day of the Week & Weather) On line 1 write a single-line comment ( use # ) to state that your program will print the day of the week. On line 2 print the current day of the week. On lines 3, 4 and 5 write a multi-line comment (use ''' ) about the weather today. Remember comments won't be printed so only the day of the week should be output. Example solution: Wednesday ⬅ 1a - Pri nting 1c - Crea ting Variables ➡
- Greenfoot Guide #6 | Counter | CSNewbs
Learn how to add a counter to Greenfoot to keep track of the score. Learn how to add and subtract points to the counter. Part 6 of the Greenfoot Tutorial for the Eduqas / WJEC GCSE 2016 specification. 6. The Counter Greenfoot Tutorial 1. Import the Counter The counter class can be imported into your Greenfoot world. Select Edit in the main Greenfoot window then ' Import Class... ' and choose Counter . Watch on YouTube: The Counter class will appear in the Actor classes list . Right-click on the Counter, choose the ' new Counter() ' option and drag it into the world. Now right-click on the background and select 'Save the World' once you have dragged the counter into the world. 2. Increase the Counter by 1 Two lines of code are required to increase the counter . Add this code when your main character is removing the collectible object . This code allows your main character to access the 'add' method from the Counter class . The method 'add ' just increases the value of the counter by the number in the brackets . To decrease the counter , type a negative value in the brackets, such as -1 . < Part 5 - Play Sounds 3. Compile and Run Click the Compile button at the top of the code editor . Then you can go back to the main Greenfoot window and click Run to test if your counter increases . Click on me if you've got an error that you're stuck with. Part 7 - Extension Ideas >
- 5.2 - Integrated Development Environment - OCR GCSE (J277 Spec) | CSNewbs
Learn about the tools of an integrated development environment (IDE) including the editor, error diagnostics and run-time environment. Based on the J277 OCR GCSE Computer Science specification (first taught from 2020 onwards). Exam Board: OCR Specification: J277 5.2: Integrated Development Environment Watch on YouTube : IDE Tools An IDE (Integrated Development Environment ) provides programmers with the following facilities (tools ) to help create programs : Editor The editor is software that allows a programmer to enter and edit source code . Editor features may include: Automatic formatting (e.g. automatic indentation). Automatic line numbering (this helps to identify exactly where an error has occurred). Automatic colour coding (e.g. Python IDLE turns loop commands orange and print commands purple). Statement completion (e.g. offering to auto-complete a command as the user is typing.) Error Diagnostics & Debugger Break point The programmer selects a specific line and the program displays the variable values at that point . The code can then be executed one line at a time to find exactly where the error occurs. This process is called single-stepping . Variable Watch / Watch Window cost Displays the current value of a selected variable . A variable can be watched line-by-line to see how the value changes . Trace Logs the values of variables and outputs of the program a s the code is executed line by line . Both tools are used to display information about an error when it occurs, such as the line it occurred on and the error type (e.g. syntax ). These tools may also suggest solutions to help the programmer to find and fix the error . Compilers & Interpreters Both tools convert the source code written by a programmer into machine code to be executed by the CPU. A compiler converts the entire source code into executable machine code at once . After compilation, the program can be run again without having to recompile each time. An interpreter converts source code into machine code line by line . An interpreter must reinterpret the code each time the program is required to run . See 5.1 for both types of translators. A runtime environment allows a program to run on a computer system. It checks for runtime errors and allows users to test the program . A runtime error occurs as the program is being executed , such as dividing a number by zero . A commonly used example is the Java Runtime Environment . This allows programmers to design a program on one platform ( using the programming language Java ) which allows the finished program to then be run on many others systems . A runtime environment enables the tools above such as a trace and breakpoint to be used. Run Time Environment Q uesto's Q uestions 5.2 - Integrated Development Environment: 1. Describe the purpose of each type of IDE tool : a. Editor b. Interpreter c. Compiler d. Error Diagnostics / Debugger e. Break point f. Variable Watch / Watch Window g. Trace h. Runtime Environment [ 2 each ] 5.1 - Languages & Translators Theory Topics