VEOVEI KER rm mn poba ma R ooE EC ma A Du ko TE za me - Mi Mb A JE kliteki UR ea rove z zda V im tz! | i zi A l ' | Writing programs Program diagrams | A s is hke the rules for a game. or the recipe for a cake lfthereisa When you are writing a program it sometimes helps to draw a diagram like the one mistake in the rules, or the recipe, you will not be able to play the game below, showing the main steps you need to solve the problem. A diagram like thisis properly, or bake a good cake. In the same way, the results you getfroma called a flowchart. lt shows each of the steps the computer needs to carry out, andthe computer depend on the instructions you give it. To write a program fora oki Kao aša computer you first need to study what you want to do very carefully and work out the mat steps needed to achieve the result you want. Letter program nor mamila, VI va Imagine trying to write a program to tella You need to work out exactly whatthe robot to post a letter. A simple instruction robot needs to do to post the letter. Its as shown above would be too difficult for computer needs instructions telling it the robot's computer brain to understand. whatto doatevery stage. | A flowchart has different shaped boxes rectangular boxes and decision boxes, | for different steps in the program. The where the computer can do different beginning and end of the program have things depending on the information it K no round boxes, instructions telling the receives, are in diamond-shaped boxes. 1 | MUST POST | computer to do something are in The lines show the possible routes the zi tront dc ; A THIS LETTER computer can follow. gendoo, Go outandS Find pos ost jete sami 5 m . | AP 4 4 % | Atter working out all the details ofthe the computer, or errors of logic in your ' program you can translate it into BASIC program. Before you can get the program and test it on the computer. The program to work you have to find al] the bugsand will probably not work straight away correct them." Sometimes, a bug makesa though, as there will probably be some program produce a slightly different bugs in it. These may be typing mistakes result which you may prefer. Useful bugs 9 made when you typed the program into like this are called "pugs". "There are some tips to help you find bugs on pages 42-43. -— s mm - .. Ni Masanoi POEOIEFAI TE ITEV E MAM KE TTT TSI Ii Mm