
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

































Computer Science @ Kingswinford
AQA Computer Science
Computer Science @ Kingswinford
AQA COMPUTER SCIENCE
CHEAT SHEET GUIDES TO SUPPORT LEARNING
This cheat sheet book has been created to support learning in AQA Computer Science lessons. It is not endorsed by AQA in any way. However, they have commented about my resources on twitter:
This guide goes through each topic in the AQA scheme for learning. The guides are designed to jog your memory or explain things in a simple manner so that the concepts can be grasped.
They do not cover ALL the aspects of AQA computer science. Lessons should go into much more depth than in this book. They are just an aid to support learning. There are 35 topics and these are listed below in the order of this book:
1. Computer Systems 13. Bespoke Data Structures 24. Input and Output Devices 2. Expressions and Types 14. Software Development Life Cycle 25. Prototyping and Testing 3 3. Constants and Variables 15. Prototyping and Testing 1 26. Algorithm 4. Selection 16. Bits and Bytes 27. Language Libraries 5. Repetition 17a. Binary 28. External Databases TEXT 6. Boolean Operators 17b. Hexadecimal 29. External Databases SQL 7. Arrays 18. Character Sets 30. Networks 8. Flowcharts 19. Sound 31. Client Server Model 9. Trace Tables 20. Bitmap Images 32. Client Side Programming 10. Errors 21. Instructions and the CPU 33. Server Side Programming 11. Functions and Procedures 22. Memory 34. External Code Sources 12. Scope 23. Secondary Storage 35. Computer Technology in Society
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3. Unported License.
What are values, variables, operators and functions?
What data types do the following belong to?
1 Yes abc 3.4 No
Don’t know? Find out!
Common Primitive Data Types
Numbers Characters Logical
Integers Real Numbers
byte short int long float double char Boolean
Constants are useful for making your code simpler. Also, once you have declared the constant, it can be changed by the programmer if required. Declaring the constant at the start means that you don’t have to go through the entire program, changing each occurrence in turn.
E.g. A game was designed where the constant speed of the character was set to 5. After testing the game, the user thought the speed wasn’t challenging enough so the programmer changed the constant speed to 10. Once defined, a constant remains the same throughout the execution of the application/game.
Variables are used when a value needs to change during the execution of the program.
E.g. A game has a scoring system. When the character shoots a target, 1 is added to the score. Score is a variable ; it changes every time a target is hit. If a value changes within a program then it is called a variable.
So constants remain the same and variables change. Got it!
My speed is constant! It never changes.
My score changes every time I get a question right. So it’s a variable!
The three most common loops are a FOR loop, a WHILE loop or a REPEAT UNTIL loop.
FOR FOR i ← 1 TO 5 OUTPUT i ENDFOR
WHILE (^) WHILE myVar ≠ 100 OUTPUT myVar myVar ← myVar + 1 ENDWHILE
OUTPUT “Enter a number” num ← INPUT OUTPUT num UNTIL num = 5
10 green bottles sitting on the wall, 10 green bottles sitting on the wall, and if 1 green bottle should accidently fall. There’ll be 9 green bottles sitting on the wall.
Hold on a minute, why am I repeating myself?
For as long as the variable i is 1,2,3,4 or 5. Display the variable i. (each time this loop runs it will add 1 to i)
While the variable myVar is not equal to 100, output the variable myVar and reduce myVar by 1.
Repeat the command, “Enter a Number” until the number 5 has been typed in.
Yippee!
Let’s play a sorting game!
Circle the shapes that are black AND have straight edges.
Well done! Now circle the shapes that are white OR round.
Super! Now circle the shapes that are NOT squares.
Miss, that was too easy!
I’m glad you find it so easy. Now tell me if these arithmetic expressions create the Boolean value TRUE or FALSE.
Why so many You need to learn the^ symbols? meaning of all the symbols below.
Start or Stop
E.g. product ID, barcode, name, option choice, email address.
E.g. calculations, saving, printing, anything that HAPPENS!
Any question with a Yes or No response.
E.g. customer details, invoice, payment details.
Start / Stop (terminators)
Input box
Process
Decision box
Storage
E.g. a receipt, an invoice, certificate, report.
Printed output
It is sensible to use a trace table in the design stage of your program.
Break down your code into steps. Each step should be a row in your trace table. Each row should show the “state” of your variables for that step.
But I am always logical?
This may be the case but when you make a program it is not always easy to spot logic errors. So we use trace tables to spot the things we may not!
Oh!
I have made this one for my “Shoot the Balloons” game. It tracks the score at each stage. When the balloon is hit, the user scores 10 points. Have I done it right?
Balloon Hits Score 0 0 1 10 2 20 3 30 4 40 5 50 6 60
Yes, this is a good example of a simple trace table. They will become more complex as you learn more about programming.
Programming languages allow you to trace variables in the console when running your code. It is important to learn how to do this for each programming language that you use.
A procedure just “does something” A function returns a value
OR in even more simple terms...
So procedures “do something” and functions “return a value”
Brushing your teeth is a procedure. You perform the same routine every day. E.g. put toothpaste on brush, brush teeth for two minutes, spit, and clean brush. These actions can all come under the procedure name “Brushing my Teeth”. Once the routine has finished there is no value to return, it has just finished.
Counting your computer games is a function. You look at your pile of games, you count them all and you are left with a value. Every time you count your games you do the same routine, add 1 each time, and at the end you are left with a value.
Yes, the value doesn’t have to be a number though. It could be string, characters or anything really!
Different Types of Scope:
You can’t see me because I was declared INSIDE the procedure.
If I use a variable inside a procedure, can I use it Only if it has been declared as a global variable. For a variable to somewhere else in my code?
be accessible anywhere, it needs to be defined as a global variable at the beginning of your code.
Procedure Scope
Module Scope
Project Scope
Global Scope
Hello, I am looking for the Name variable?
Procedure Scope is where a variable is declared inside a procedure.
Analyse
Design
Implement
Test
Evaluate
Maintain
But I just want to get started and write my code! It is good that you are keen but you do need to go through all of the steps or else you will make a lot of work for yourself when things go wrong!
Analyse – What does your program need to do?
Design – What will it look like?
Implement – Let’s code it!
Test – Does it work?
Evaluate – Does it work effectively?
Maintain – Does it still work now it is being used for real?
Expressions and Types Variables and Constants Selection
Repetition Boolean Operators Arrays
Flow Charts Trace Tables Errors
Functions and Procedures Scope Bespoke Data Structures
Software Development Life Cycle
Yay I get to make something! Yes, and remember to follow the Software Development Life Cycle whilst doing this!
The symbol ^ means “to the power of”. This should be familiar to you!
How computers think
How humans think
D 4 8