Magazine 2

Page 1


2

GCSE Computing Magazine

GCSE Computing issue 1 – February 2014 1. Travelling the world from Bristol to Shanghai by train – using the internet and databases to make short work of train schedules 2. Robots are cool – how they work and what they do 3. Computer vision – can computers really be programmed to see? 4. Binary mathematics – a short introduction to the world of binary numbers 5. The fetch-execute cycle - the heart of the computer 6. Programming – the options for learning to programme and where best to start 7. What is computer science? Message from the editor GCSE Computing magazine is aimed at students of computing as a GCSE subject who want to be inspired and stretched. It is also aimed at students who have not yet started a GCSE course and want to get ahead. GCSE Computing magazine may also help non-specialist teachers of computing who were happy teaching ICT but may feel daunted by the more technical aspects of computer science and their real world applications. Computing has always been an important subject, but has become even more rewarding in some ways now that it is a part of the English Baccalaureate for students age 16. The Ebacc will likely increase the demand for computer science and resources for computer science learning in schools throughout the UK. There are always new and exciting things to learn in computing and computing education. Over the coming months, we hope to grow into a living textbook to blend fundamental concepts into real examples. This magazine is designed to be read on an iPad, and offers a rich variety of text, graphic and video explanations with hyperlinks to further resources. We hope that the magazine will bring a broader angle to the study of computers for students as well as teachers. GCSE Computing magazine is produced by the London E-school Ltd, which will launch online GCSE computing classes on weekends from September 2014. More details about online computing lessons will be in our March issue. Olly Wells Editor


GCSE Computing Magazine

Exploring the world by train! I recently went on a trip. I live in Shanghai, China, and I decided I would quite like to visit some friends in Bristol, England. I enjoy travelling by train because I can more easily use my phone and,unlike when flying, I can stretch my legs. I also like that I can take a break somewhere along the way if I want to. The trouble was that I knew travelling from China to England was going to take a long time. I needed to change trains quite a lot, and the number of tickets I needed to buy was huge. I could have used a travel agent, but the price would probably have been much higher than if I booked everything myself. After a lot of research, I decided that booking everything myself was the best idea, especially because then I would better understand the route if there were any unexpected delays. This article is all about how I did the research, made the bookings, and the computer systems involved. To start off the planning process, I sat down at my computer with a pen and paper. I decided the approximate date I wanted to start my journey and when I wanted to arrive, which was about 10 days after I departed. I printed off and looked at a map of the world to see which countries I would need to travel through, and then started researching the train ticket booking websites for these countries. In all, I needed to travel through China, Mongolia, Russia, part of Eastern Europe, and across the English Channel by Eurostar. I changed trains in Beijing (China), Moscow (Russia), Brest (Belarus), Warsaw (Poland), Cologne (Germany), Paris (France) and London (England), before arriving in Bristol. The whole train journey took 180 hours, excluding time spent in hotels between trains. Including hotel stopovers it took around 10 days. It would certainly have been quicker to travel by plane, with fewer visas needed in my passport. The first website I needed to find was to book the train ticket from Shanghai to Beijing – I searched using the keywords ‘Shanghai to Beijing train ticket’. I found the website http://www.chinatrainguide.com/shanghai-railway-station/beijing.html. It was difficult to buy online, even using the official website http://www.12306.cn/mormhweb/ so I went to a ticket office to buy my ticket. After my failure to buy online to go to Beijing, I was hoping I could buy my ticket from Beijing to Moscow online. I searched using the keyword ‘Beijing to Moscow train tickets’ and soon discovered that if I wanted the best value I needed to travel to Beijing to buy the tickets weeks in advance or go to the same ticket office I had visited for my tickets to Beijing. Before going to ticket office again, I decided to research the rest of my journey. I didn’t want to keep going back to the same ticket office for no reason. From Moscow to London it was easy to book online using the German train ticket website www.bahn.de allowing me to book all the way through from Moscow to London. I received an e-ticket via email, which I printed and placed carefully with my passport. I bought my ticket

3


4

GCSE Computing Magazine

What about the computer systems? The computer systems involved were vast. I was making use of the internet, websites, databases, online credit card transactions and all the hardware supporting the computers involved at every step of the way. These systems are all supported by protocols and standards that define how the computers should communicate, and how they should be designed so they can work together. Without all this technology I would have been forced to plan my journey with a large number of train schedules, if I could even get hold of them from so far away, or simply to travel from station to station hoping I can get the next tickets when I arrived. I used the internet in two main ways. Firstly to search for information about where I could purchase tickets, and secondly to make requests from websites for information contained in databases held by those websites. This is one of the most useful features of websites. Nearly every visit we make to a website involves a database. When I visit www.bahn.de and search for the train times between Moscow and London, the first stage involves the browser on my computer making a connection to the website and requesting the pages of the website as HTML. My browser than presents the website on my computer screen. The next step is for me to type in the names of the stations I would like to travel from and to, as well as the dates I hope to travel. My browser will then send this information back to the website using HTML, which is a standard so the web

photo by Boaccaccio1


GCSE Computing Magazine

site receiving the request will understand the format of the request without any extra explanation. The request will travel in the way described by the TCP/IP protocol to enable all of the parts of the internet, including my computer and the computer or server the www.bahn.de website is stored on, to communicate clearly. The website will then make a request to the train timetable database it has access to and will return the result to me on my computer screen through my browser. Only the answer to my request will be sent to me along with the format of the page to display the results; there is no need to send the whole database over the internet and this saves a lot of time. When I purchased the tickets using my credit card, it was a similar but more secure process to check my credit card details were correct and to check I had enough credit to pay for the ticket. The website then sent me an email of my booking details to use on the train. Having taken a long time to get to Bristol, I decided to fly back to China by air. I travelled with Virgin Atlantic direct between London and Shanghai. Booking my ticket was very similar to booking the train tickets. Journey time summary Shanghai to Beijing – 5 hours Beijing to Moscow – 132 hours Moscow to London –40 hours London to Bristol – 3 hours Total: 180 hours Websites for further reading The Trans-Siberian experience A Trans-Siberian blog Another Trans-Siberian blog Keeping busy for seven days on a train Thinking points Why do computers need protocols and standards? Where are websites stored? Why is there a train line between Moscow and Beijing? Key GCSE Computing course concepts: Databases, Internet, Browsers, Protocols and Standards Keywords Online: activity done on the internet rather than in the physical world. Browser: a piece of computer software used to display and navigate websites. Protocol: a protocol is a set of rules governing how devices communicate. There are social protocols too, like shaking hands when you meet someone. Standard: A standard is a set of rules and methods followed to ensure computer hardware and software is compatible with other computer hardware and software. HTML: HyperText Mark-up Language is a standard commonly used to record the formatting of a website. HTML is read by a browser to display a website in the correct formatting. HTML 4.0 was released as a standard in 1999. TCP/IP: Transmission Control Protocol/Internet Protocol is the protocol used to send packets of data around the internet. It was originally created by the US Military.

5


6

GCSE Computing Magazine

Robots are cool How they work and what they do Robots are defined by www.OxfordDictionaries.comas “machines capable of carrying out a complex series of actions automatically, especially one programmable by a computer”. The word Robot comes from the wordrobota in the Slavonic language, which means ‘forced labour’ or ‘servitude’, and was first spoken in a play in the 1920s. Although the word robot originates from ideas of slavery, the modern use of robots is to assist human activity and not to take advantage of robots as if they were captured prisoners. Robots range from very simple to very complex. They can repeat instructions given to them through programming, or if their programming is sufficiently complex can determine their own instructions to aid them in achieving a specific goal e.g. walking over the ground looking for water on Mars. Being able to repeat instructions over and over without any loss in the quality of the work done is one advantage of robots, because unlike humans, they do not get tired and they do not need to sleep. A common use of robots is in manufacturing assembly lines to assemble products like cars. Robots do not need to be equipped with artificial intelligence or even be able to walk or move. Some robots are gigantic, fixed on factory production lines, built with very strong materials and components. These strong robots can lift much heavier materials than a human, and can work in conditions that would not be safe for humans. An example of this would be spraying paint onto a car. A robot does not need to have clean air to work, and can paint much faster than a humanwith far greater accuracy. Very few robots are programmed to learn. This makes robots dependent on their programming to be able to complete tasks. The work of the programmer is very important to give robots instruction. Programming can be done with computer code, but also by showing the robot what to doand letting it record and mimic the actions over and over.


GCSE Computing Magazine

Robots are not only found in manufacturing. We have not yet started to see people have robots in their homes, cooking and cleaning, but there are a few robots like the Roomba floor cleaning robots that can clean the floor in your home. Google are working on a robotic car that does not need a human to drive it, and robots have even been sent to Mars and to the Moon. Apart from a computer to issue instructions, the most fundamental piece of hardware found in robots is the servo. A servo is an electronic device with a small motor built inside. The motor is used in robotics at joints to move part of the robot e.g. the elbow in a robotic arm. Servos can be built for speed but also for strength. Each direction a joint or part will need to move will usually require an additional servo. Servos are also used for steering the wheels on robotic cars. The more complicated or precise a robot is, the more servos it will usually have. Robots usually have a range of inputs and outputs controlled by a computer. Typical outputs are audio equipment, the parts of the robot that are moved by servos such as arms or wheels, and other devices e.g. spray cans used to paint cars. Inputs include lasers for judging distances, sensors for sensing movement, pressure and even light, as well as audio and visual inputs. Some basic robots can do little more than follow a line marked on a factory floor while others have gyroscopic sensors to judge balance. This cycling robot is an excellent example of a robot with a gyroscopic sensor used to judge balance. It is necessary to be very carefulwhen working with robots, because if a robot is not programmed to watch out for humans near it, people can easily get hurt. This can happen if, for example, a person is sprayed with paint or if a heavy object is moved through where a person is standing by a robot that cannot see the person getting hurt. Strict safety rules are put into place, and robots are often fitted with equipment to check the space they are moving through is free from humans. The US and UK military have, over the last few years, started using drones. These are usually radio controlled aircraft equipped with satellite tracking, audio, video equipment, and sometimes guns and rockets. Some people are concerned that military drones could be programmed to operate as robots without a human controller. A famous science fiction writer called Isaac Asimov imagined a world where human-like robots interacted with humans in everyday life. He wrote a set of laws to govern how robots should treat humans to avoid robots taking over the world. His laws are called the three laws of robotics.

7


8

GCSE Computing Magazine

This has been a brief introduction to the world of robots. Visit some of these websites to learn more: Can robots care for the elderly? Robots for sale Robot kits you can make Robots for young children Robot security guards China’s moon landing robot NASA’s Curiosity Mars landing robot Iran captures US drone Key GCSE Computing course concepts: Input, Output, Programming, Computer Systems Keywords: Robot: A computer controlled mechanical device often used to repeat a series of complex actions Servo: A device with an electronic motor used to control robotic movement Programmer: A person who give instructions to a computer Program: A set of instructions for a computer to follow Input: Where data is going into the computer Output: Where there is an action or data coming out of the computer Manufacturing: Building something from components Thinking points Can you think of any repetitive skilled tasks in your life you would like a robot to do for you? Do you think it is a good idea to create robotic military drones – could something go wrong? Look at the video of the Roomba floor-cleaning robot – what input and output devices do you think it has?

photo by Eirik Newth


GCSE Computing Magazine

Computer vision Can computers really be programmed to see? Computer vision is about making it possible for computers to be able to see and understand what they are seeing, just like you or I are doing right now. Improved computer vision would have a huge number of uses. Some uses would allow us to let computers do jobs done by people that computers cannot yet do, such as watch CCTV to look for people or to count how often a sponsor’s name is seen during a sports game. Computer vision includes using computers to analyse information such as videos and images through a camera as well as using lasers and other devices to see. Where computer vision is used in a manufacturing situation such as a factory, it is often called machine vision. The focus of machine vision is on letting machines such as robots see enough to conduct their work. It often lets computers see, but not in the way you or I see. This type of vision can be very limited; for example, using lasers to measure distances or looking at images in very controlled simple conditions. If a computer was controlling a machine to cut a piece of metal to a very precise measurement, the computer could use a laser to measure where to cut when positioning the cutting equipment. It is useful because it allows computers to see on a limited scale. Lasers are frequently used in machine vision to measure distances in manufacturing, and also to measure distances when controlling aircraft.Machine vision can involve complex digital images, but rarely complicated situations where the computer is attempting to recognise a shape or pattern in 3D where the angle or perspective can be very different in each image. Reading bar codes on products in the shops is an example of machine vision because bar codes are readable with a laser input device. The laser input device is used to read the bar code, making it machine-readable. When assembling parts in a factory, some parts will have bar codes printed on them to make it possible for robotic equipment fitted with lasers to correctly identify the parts being used. RFID tags are used in a similar way. Using computers to enable robotic equipment to operate assembly lines is useful, but the real power of computer vision comes from the very high speed computers can process what they see and the ability to continuously process over and over again with the same level of accuracy. Computers are also better able to filter out other information and not get distracted. This ability to filter out is useful in normal situations, but limits computers when the unexpected happens which has not been allowed for in the programming given to the computer. More complex computer vision requires computers to be able to take an image, either a picture or single frame of a video, and have the processing capacity to be able to analyse it in real time (live). To analyse an image, the computer will need to be able to recognise shapes and their size, taking into account perspective. Where an image contains solid 2D shapes with single colours this is easy to achieve. The computer simply needs to look at each pixel (dot of the image) and look for shapes it has been programmed to recognise as in this example where the computer recognises colours in a Rubik’s cube.

9


10

GCSE Computing Magazine

When looking at more complicated shapes in moving 3D images,computers need a greater amount of processing power and complex algorithms to be able to recognise what is being seen. Computer vision is already used extensively in sport. The well-known example is the Hawk-Eye system used in tennis, cricket and football. Hawk-Eye uses a system of 10 cameras to track the ball to create a model depicting where the ball is at any one time, allowing judges, umpires and referees to see if a ball was out or a goal has been scored. CCTV cameras are a common sight across the world. Spotting or tracking people in crowds of large numbers of people can be difficult even for the best trained and experienced police officer, but unlike police officers, computers do not tire and can look at hundreds of cameras all at once. Older speed cameras use traditional film that needs to be developed and looked at by police officers. More modern equipment, now often even seen in car parks, allows computers to read the number plate of a car from a photo. In the case of a speed camera this means the camera can access a database and look up the address of a speeding driver to automatically send a speeding fine without the involvement of humans at all. The XBOX Kinect system, where the user controls the computer game through a camera, is also a system making use of computer vision. A couple of practical applications of computer vision come from the advertising industry. When a company sponsors an event or sports team, they want to know they are getting value for money. To do this, they assign people to watch every game or race to see how often their logo is shown throughout the game, and they then look at the viewers of the event to see how many people had exposure to their company for how long as a result of their sponsorship. This is an area of computer vision still in development where humans remain more able than computers. Another use in development is smart advertising boards, which are able to see the people watching them and adjust the advert shown to fit with the type of person and interests the computer feels that person has. This is similar to the personalised adverts we sometimes


GCSE Computing Magazine

see on our web browser with adverts following us from website to website. Perfect computer vision will see a significant change in the way we use computers in everyday life just like perfect speech recognition, but for now it is an exciting area of computer science to watch and learn from. Key GCSE Computing course concepts: Input, output, processing. Programming box: Computer vision is something which only a few years ago was only available for university students to experiment with, however, the Python and C++ programming language havea free library called OpenCV which makes computer vision possible for amateur computer users with some programming knowledge. Websites for further reading: Tracking a ball using OpenCV Pool playing robot Thinking points: What advantages are there for a company to use computer vision rather than people to see? Why is processing power so important in computer vision applications? Are there things that computers can see that humans cannot? Keywords Computer vision: The ability of a computer to see and analyse what it is seeing in a meaningful way Machine vision: The use of computer vision in manufacturing 2D: A two dimensional shape or image having only two measurements e.g. height and width but no depth 3D: A three dimensional shape or image with three measurements e.g. height, width and depth Barcode: Vertical bars of differing width used to represent computer data RFID Tag: Radio Frequency Identification Tags are similar to barcodes but able to store more information and be read from further away

11


12

GCSE Computing Magazine

Binary – the native number system of computers Computers do not have fingers and toes, so they don’t count in 10s. Computers count in 0s and 1s, on and off, true or false. This is the natural system for computers, because while they cannot count in 0s and 1s, they can turn the electrical current on and off inside their circuits. All data in computers is at some stage transferred into binary.

To represent one hundred and one – 101, we use one unit and one hundred. It is similar in binary and this can save a lot of time when using binary.

The binary system is a system of 0s and 1s.The binary numbers 1 to 10 are shown in the table here.

The binary equivalent of thousands, hundreds, tens and units 256s 128ths 64ths 32s 16ths 8s 4s 2s Units 256 128 64 32 16 8 4 2 1 0 1 1 0 0 1 0 1 0

Binary 1 to 10 Binary 0 1 10 11 100 101 110 111 1000 1001 1010

Decimal 0 1 2 3 4 5 6 7 8 9 10

Thousands, hundreds, tens and units Thousands Hundreds Tens Units 0 1 0 1 To represent one hundred and one in binary, we need one 64 one 32 one 4 and one unit as shown below.

An easier example would be the number six needing one 4 and one 2. The binary equivalent of thousands, hundreds, tens and units 256s 128ths 64ths 32s 16ths 8s 4s 2s Units 256 128 64 32 16 8 4 2 1 0 0 0 0 0 1 1 0 0

It is possible to show negative as well as positive numbers in binary. Binary can also be used to work with fractions and numbers with decimal points (real or floating point numbers) not just integer (whole) numbers. Mathematical operations including addition, subtraction, multiplication and division can also be applied to binary numbers. Negative binary numbers are often referred to as signed.

Keywords Binary: A number system using only 0s and 1s Decimal: A number system using the numbers 1 to 10 Signed: When binary is used to display negative numbers, the number is called a signed number Key GCSE Computing course concepts: Binary numbers Websites for further reading Using binary to represent numbers Binary arithmetic Thinking points Why do computers use binary rather than the decimal number system? How does the hexadecimal fit into computer science? What number system will quantum computers use? How do computers create random numbers?


13

GCSE Computing Magazine

The heart of the computer The fetch-execute cycle The fetch-execute cycle is at the heart of absolutely everything happening in a computer from a key being pressed on the keyboard to the colour of each pixel on a computer screen.All activity with a computer will involve instructions passing through the CPU, and more often than not the CPU giving instructions to other components. The CPU (Central Processing Unit) is fundamental to the fetch-execute cycle because the CPU gives the instructions to fetch instructions from memory and then executes them, and for this reason the CPU controls the computer. The fetch-execute cycle is continuous. It happens as fast as the CPU can process, but is sometimes slowed down by other components which operate at a slower speed than the CPU. This can mean that the CPU is waiting for instructions to arrive. While the fetch-execute cycle is happening, the CPU is entirely focused on the instructions it is carrying out. This is fine as long as there are no urgent instructions waiting, for example if a key has been pressed on the keyboard or the wireless card is receiving data through the internet. To avoid peripherals having to wait for the CPU to become free, the CPU checks for urgent requests once in each cycle of the fetchexecute cycle. These messages are known as interrupts. The CPU fetches most instructions from the RAM (Random Access Memory). This type of memory allows the CPU to fetch instructions directly from the location the instruction is stored within the RAM. Other types of memory only allow instructions to be fetched from the top of the list just like a queue at the supermarket – only the person at the front of the queue can be served. An example of a type of memory not allowing random access is a stack another is magnetic tape. To access items in memory directly stored in RAM,the CPU needs to know where the instruction is stored. The location in memory something is stored at is known as the memory address. The information being fetched is not always an instruction; it can also be data needed to carry out an instruction that has already been fetched. CPUs sometimes store very small pieces of information in a very small area of memory built into the CPU called a register. The CPU may also decide to use all its registers together to simulate a stack. A simple example of the fetch-execute cycle in action would be as follows. The computer fetches the number 6 from the RAM. It then fetches the instructionadd followed by the number 5. It then receives the instruction to store the result in a new memory location. This sequence has been simplified a little, because in reality there would also be instruction to store the numbers 5 and 6 locally in the stack and to then retrieve them from the stack to add them together, as well as deciding where to store the result in memory. An assembly language example of the addition example above would be as follows: MOV R1, #0X000010005; get the value from memory address 0X000010005 and store it in the register R1 MOV R2, #0X0A0000011; get the value from memory address 0X0A0000011 and store it in the register R2 ADD R3, R1, R2; Add the value in register 1 to the value in register 2 and store it in register 3 In this example, the CPU is storing data in registers. To better understand this example see this website about assembly language. Each instruction fetched by the CPU will need to be decoding for the CPU to know what to do. Decoding is a simple process for the CPU to lookup the meaning of an instruction in a table stored within the CPU. The speed of a processer is measured in hertz. This is the number of instructions per second the computer is


14

GCSE Computing Magazine

able to fetch.It is possible to make a computer work faster by overclocking. Overclocking was a popular technique in the past for forcing CPUs to run at a faster speed to give computer users a faster computer experience. CPUs have a cache to store some instructions– memory built into the chip for working space to keep instructions ready for when needed. Sometimes, the CPU will need to wait for instruction to arrive not just because of the size of the cache, but also because the route the instructions travel from memory to the CPU is slower than the CPU. Instructions between parts of the computer travel along a bus, and the slower the instructions travel along the bus, the longer the CPU may have to wait for instructions to arrive. A typical CPU can only process one instruction at a time. To allow computers to work faster, CPUs can be combined together into dual or multi-core processors that are able to process more than one instruction at a time. CPUs can get very hot, and for this reason they usually have a fan or heat sink on top of them to help keep them cool. A heat sink is designed to move heat away from the CPU. Websites for further reading Different images explaining the fetch-execute cycle The fetch-execute cycle A level information on the fetch-execute cycle RAM and ROM What is ROM? Thinking points If the CPU is the brain of the computer, what is the RAM? What would happen if the CPU did not have interrupts in the fetch-execute cycle? What ways are there to upgrade a computer to make it run faster other than putting in a faster CPU? Keywords CPU: The CPU is the area of the computer often described as the brain of the computer. CPU stands for Central Processing Unit. Stack: The stack is a memory structure where the first item in is the last item out. RAM: Random Access Memory – a type of memory that allows direct access to any area within it, using a memory address. Most programs running on a computer are stored in RAM while they are running. Heat sink: a device used to cool the CPU. Bus: The piece of computer hardware used to send data to and from parts of the computer. Assembly language: a low computer language where the instructions are very similar to the CPU’s machine code instructions. Key GCSE Computing course concepts: CPU, Programming, Fetch, Execute, Decode, Fetch-execute Cycle


GCSE Computing Magazine

Programming – the options for learning to programme and where best to start There are so many different ways to get an introduction to the concepts and ideas of computer programming that it is hard to know where to start. Once a student has exploredcomputer programming fully, they should have an abilityability to program in one or more higher level programming languages. Along the way, in orderto becoming proficient,a student needs to become aware of and then comfortable with programming fundamentals such as variables, decisions, loops, arrays, procedures, functions and objects as well as many others. One of the best ways to start is through drag and drop interfaces, and there is no better place to do this than Scratch. Progressing on from Scratch to Greenfoot provides a good introduction to Java. From an introduction to Java, it makes sense for students to start using Java or Python. With so many different organisations offering free tutorials on programming from Khan Academy to Code.org it is as easy as deciding where to start. Along the way, to becoming comfortable programmers, students will need to learn some HTML and during A level should learn how to connect websites to databases using scripting languages such as ASP or JavaScript. With these milestones in mind it is possible to chart a healthy programming language development route from Scratch to the higher level language of choice. Years ago, computer science students would start with languages such as Pascal and BASIC with some learning C or others even older languages such as FORTRAN. These languages are useful to know but have probably had their day. For information on each language or program mentioned above as suitable for learning, see the sections below. It is also important that students have some understanding of assembly language, but that is a bigger issue to cover in a different article another day. Unfortunately, none of the programs listed below work on an iPad, and all require a Windows, Linux or Apple computer. Scratch Scratch is an exciting drag and drop programming environment enjoyed by students in schools from New York to Shanghai. Scratch is available for free from MIT and opens up the world of programming concepts without having to know how to code. To download Scratch, visit the Scratch website http://scratch.mit.edu/scratch2downlo ad/. To get started with Scratch once you have downloaded it download the getting started with scratch pdf. Try editing some of the examples you can download from the Scratch website or that come with version 1.4 to get a feel of how Scratch works. It is possible to install both Scratch 1.4 and Scratch 2.0 to have more examples to play with. The tutorials on the tips menu in Scratch 2.0 are very useful. Try this set of blocks in Scratch 2.0 to see what will happen.

15


16

GCSE Computing Magazine

Greenfoot Scratch is extremely good, but not being able to code creates some inefficiencies and frustrations for Scratch users once they reach a certainly level of ability or try to complete tasks which are quite complex.Greenfoot is the next logical step from Scratch, because it acts as a bridge between the drag and drop and the purely programming code world. To install Greenfoot you need to download the Greenfoot programme, and you can do so from here. To run Greenfoot, you need to have the Java JDK installed. Most people already have Java installed, but you also need the Java JDK. To get this, click here. If you are searching for this on the internet, JDK stands for Java Developer Kit. A good starter activity is to open a scenario such as the balloons scenario, which comes as an example installed with Greenfoot, and compile it. Once you understand how it works, double click on actors such as Balloon and see what the impact of changing some of the code is when you re-compile the scenario. See if you can change the colour of the balloons to move up faster. Hint: the speed is -1 by default and that is the slowest. Positive numbers will not make the balloons rise. What happens should look something like this:

Detailed tutorials for Greenfoot are available from the Greenfoot website.


GCSE Computing Magazine

HTML HTML stands for hypertext mark-up language and is a very easy language to learn. The best place to learn is by far and away the WW3 school website. WW3 School is also good for learning other languages. All websites use HTML to some degree, and being able to understand HTML is always a useful skill. As you develop a greater understanding of website design you may prefer to use a software program to layout your websites, but you will occasionally still want to edit the HTML directly. As long as you have a web browser and a text editor you have enough to get started with HTML, but be careful to save the file as an HTML file. An easy early mistake is to save an HTML file in notepad as home.html.txt. To avoid this, select Save As then the file type as All Files. Try making a simple website with a heading, some text and a picture. Then try using a table to move the picture to the middle of the webpage. If you follow through the WW3 School training you will be able to do this easily.

Java Khan Academy uses JavaScript, which is not quite the same as Java. To understand the differences click here. Working with JavaScript is fine as long as you are aware there are some differences. One of the most frustrating aspects of programming in the first few sessions for a student can be learning to use the IDE available for the language. An IDE is an integrated development environment and is the software used to write and compile programs in. If you step directly from Scratch to programming in Java or JavaScript you might find it difficult unless you try Greenfoot first. Compiling is the process of converting the programming code into instructions the computer will be able to run. A good way to learn Java is to use a web based online compiler such as Compileonline.com, ideone or browxy.com. There are tutorials with each of these online compilers allowing you to program without having to install much more than Java onto your computer, so the compilers can work through your web browser.

17


18

GCSE Computing Magazine

Python Python is not the easiest language to use and the IDE software used to edit and run python programs is not very convenient either. For an easy introduction to Python you might want to try the hour of code activity available for free from Grok https://groklearning.com/csedweek/ learning. Unlike all the other activities and programs in this article most of Grok learning is not free, but the hour of code activity is great and it is free. To visit Grok https://groklearning.com/csedweek/ learning and try this out click here https://groklearning.com/csedweek/. Compileonline.com http://www.compileonline.com/ supports Python and it might be one of the easiest ways to get started with it. Python is a fabulous tool because the Raspberry Pi is programmed with Python allowing excellent hardware and software based activities to try and to impress friends with. The only issue with Python is the IDE it comes with is quite clunky at first glance which could put people off. Pyscripter https://code.google.com/p/pyscripter/and Pydev http://pydev.org/ are two alternative IDEs to the IDE known as IDLE which comes with many versions of Python. To download Python visit Python.org http://www.python.org/. There are some very good documents giving examples of how to use Python. The most commonly used is the getting started guide from Python.org available here https://wiki.python.org/moin/BeginnersGuide. Try this program to write Good afternoon to the screen in Python. All it takes is the code - print "Good afternoon"; Try some of the examples at After hours programming http://www.afterhoursprogramming.com/tutorial/P... learn more about Python. GCSE computing key concepts: Programming Keywords: Higher level language - a programming language with many features not present in machine code languages which are useful to make the program understandable when being designed. Low level language - a programming language which closely mirrors the machine code instructions understood by the computer. Scratch - a drag and drop computer programme useful for introducing computer programming concepts. Greenfoot - a computer programming environment using Java. Java - a higher level programming language. Python - a higher level programming language. Pascal - a higher level programming language once very commonly used for teaching. BASIC - a higher level programming language once very commonly used for teaching which often does not need to be compiled. JavaScript - a version of java used for adding programming features to HTML pages. ASP - a programming language used like JavaScript to add programming features to HTML. HTML - HyperText Mark-up Language used to describe websites. Assembly language - a low level programming language. Compile - the process of converting a programming language into machine code to be executed by the computer.


GCSE Computing Magazine

An introduction to computer science Computer science is about three things: how we write the software to instruct computers to do things, how the computer works inside, and how computers can be used as components in wider systems. Computer science also touches on information communication technology (ICT), but if drawing a line between the two subjects, it is best to think of ICT as a subject about using and configuring computer software for everyday personal and business needs. Computer science is about how the computer works and how software is designed, created and maintained. A lot of emphasis is placed on algorithms in computer science because they are an important way to describe what needs to be done and how it can be done best. To fully understand computers, students need to learn about the number system they use. Computers use a base two number system, unlike humans who use a base 10 system. Computers use base 2 because they do not have fingers, but can turn electrical signals on and off as they travel along wires. This creates two options: 0 for off and 1 for on, hence, the computer number system known as binary is a base two system. To make life easier, computer programmers sometime use a base 16 system called hexadecimal to represent binary numbers. Knowing how to program a computer well means students of computer science are required to master not only higher level languages such as Java or Python, but also lower level languages such as assembly language. When a student of computer science understands what is happening in a computer, they can then decide the best way to code an algorithm for speedy and smooth execution – especially where random numbers are involved! Understanding what happens inside a computer starts with the CPU and the fetch execute cycle. Beyond the CPU comes the excitement of RAM, ROM, buses, operating systems, peripherals and concepts which blur the boundaries such as virtual memory and caches. Once hardware and operating systems have been mastered, students are in an excellent position to firmly grasp how best to develop and maintain computer software for industrial, business or home use on a solid foundation or platform of a well understood operating system. Most computer systems make use of databases to store, search and retrieve information. Modern computer systems are rarely standalone, but work together in networks. The importance of databases and networks to computer science must not be underestimated. Computer science is not just about learning; it is even more about doing exciting projects based on the knowledge you already have to be able to learn even more!

19


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.