Computing Grade 8 Revision
Computing Grade 8 Revision
Variables are used to store data, and they are a fundamental part of any program.
Values (data) can be assigned to variables using the = sign or provided through user input. Once assigned, the value is
stored in the variable.
Data Types - is a way to tell the computer what kind of information a variable will hold. Think of data types like different
kinds of containers that hold specific types of stuff. Each type of data has its own set of rules for how it can be used.
Integer - These are whole numbers, like 5, -12, or 0. They don’t have any decimal points.
Float - These are numbers with decimal points, like 3.14 or -0.5. They can be used for more precise measurements.
String - are used to represent text. For example, "Hello, World!" or "Grade 7 Student" are strings. Strings can include
letters, numbers, and special characters, but they’re always treated as text.
Boolean - This data type has only two possible values: True or False.
Input - The value assigned to a variable, either by the programmer or entered by the user.
Pseudocode - is a way of planning out a program by writing down the steps in plain, simple language, instead of using
actual code. Pseudocodes should be:
-easily understood
-easily translated
-describes the complete process
Flowchart - a visual tool that shows the steps of a process or an algorithm in the form of a diagram.
When developing a program, there are stages or iterative process that needs to be followed:
Stage 2 – Designing
Stage 5 – Implementing
A test plan is used to check if the objectives if your program has been met. Programmers use test data to run program
and check if there’s any issues or if they are successful. A trace table is used to check the algorithm if it follows the
variable and coniditions.
Debugging refers to finding and fixing errors.
Decomposition is a method to break down problems into smaller sub problems to easily solve it.
Logic errors are caused by conditional operators or statements. Check if the results follow the algorithm. Make sure
that the conditional operators are properly set to avoid logical errors.
Loops allow statements to run multiple times. One example is the for loop. It is a count-controlled loop which means
program instructions can be repeated a specified number of times.
The loop variable i always starts at 0 (zero) and the loop is executed until the value if the loop variable is the same as the
range().
Array - is a data structure, which can store a fixed-size collection of elements of the same data type.
Example 1 here:
fruits = ['apple','banana','orange','grapes','mango']
print(fruits)
Example 2 here:
fruits = ['apple','banana','orange','grapes','mango']
for i in range(5):
fruits.append(input("Enter another fruit: "))
print(fruits)
#in the loop, it will allow the user to input 5 more values to the fruits list using the .append funtion