> a na MARKER REZ RSETEENIE ERI AEO ENAKA bata nate Nana na ——>—>—ž>o——n m A donna naenkrat a em. More about variables /[ Onmost computers you < | needtoleaveaspace | either side ofthe variable, inside the guotes Thesewere | storedin memory spaces X$ andA. Spaces /A PRINT "| ATE ".X," PEANUT BUTTER AND ".A$," SANDWICHES I ATE 6 PEANUT BUTTER AND CHEESE SANDWICHES I WISH | WAS AS CLEVER AS A ROBOT Xa xX sa porumeni PRINT "1 ATE ".Z:" PEANUT BUTTER AND ".C$:" SANDWICHES tes | ATE 12 PEANUT BUTTER AND JAM SANDWICHES So far you have seen how to use PRINT to PRINT to do calculations on a computer. Printing variables by themselves is not the vanable must have a semi-colon either display words and numbers onthe You can find out how at the bottom ofthe very useful. You usually need some words sideofit, as shown above. If you want to screen, and to print out the contents of page. Onthe opposite page you can find with them to say what they are. To pnnt space 0ut the information you can use variables. Below you can find out how to out more about doing things with words and a variable together the words cormmas instead of semu-colons. use commas and semi-colons to space vanables. must be in guotation marks as usual, and things out on the screen. You can also use These lines show how you canuse is. The picture above shows how the lines During a program you can change the Next time you ask the computer to print commas and semi-colons to tell the would be printed on the screen. The word contents of memory spaces like this. To the variables it will display the new words computer where to print the next letter. A PRINT onaline by itself tells the computer the computer these statements meanadd andnumbersstored in the memory comma tells it to move along the screena to leave an empty hne. one to the figure in memory space X and spaces. bit and a semi-colon tells it to stay where it | add "MY" to the letters in C$. 5 Program puzzles s. pa izka Vdm-i 1. Write a program to add numbers to neans the variables in the program on the left itipty, 30 PRINT AxB so that it would print out the answers eans divide 40 PRINT A/B 100 and | on one line with a space 4SOR means 50 END No between. RUN 2. Change lines 30 and 40 so that they print out the numbers, what you are doing to them and the answer, e.g. "1 times 9is 63". 3. Change your answer to the program 63 1.28571 You can do sums with variables too, as sums. e the normal The computer can also do more shown inthe program above. The erto EO a and a dlak and x complex mathematical calculations such computer finds the numbers inthe puzzle on page l$so it prints Your name 0 as sines, cosines, sguare roots, etc. memory spaces, then works out the sums. and the message on one line. for multiplication and/ for division.