Nothing Special   »   [go: up one dir, main page]

Answers G7 T1 Review Pack

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Computing Department

Grade 7

Theory Questions
Unit 1
Academic Year 2024/2025

)Cambridge International School(


Unit 1
Computational thinking and programming
1.1 Flowcharts – page (9)
Key words [Data flow, flowchart, input, output, process, variable]
Data flow: the arrows that show you how to move through the flowchart.
Flowchart: a diagram that shows a sequence of steps that should be followed.
Input: for the user to enter data. The questions here:
Output: to display words and numbers to the user. 1. Fill the blanks.
2. True or False.
Process: to do a calculation or action. 3. Match.
Variable: a named storage location where you can store data. 4. Define.

Questions 1.1 Page No.(12)


1. What is the shape of the output box? Parallelogram .
2. What is the shape of the process box? Rectangle .
3. How many data flows go into a start box?

4. How many data flows go into a stop box?

1
Questions 1.2 Page No.(25)

1. Create a flowchart to output the chorus of a song, one line at a time.

2. Create a flowchart to take a number as input, divide the number by 2 and output the result.

3. Create a flowchart to take a distance in miles, convert it to kilometres and output the result.
1.2 Selection and logic in flowcharts – page (26)
Key words
1. AND: Boolean operator that has a true result when both conditions are true.
2. Boolean condition: a condition that can only be answered by true or false.
3. Boolean logic: a set of rules that are used to test conditions, and the rules are applied to the inputs
of a logic gate to create different outputs that are either true or false.
4. Comparison operator: <, >, =, <=
5. Condition: a test that gives a true or false result.
6. IF, THEN, ELSE: the three parts of a selection statement
7. NOT: Boolean operator that has a true result when the input condition is false.
8. OR: Boolean operator that has a true result when either condition is true.
9. Selection statement: used when a decision needs to be made in an algorithm.

Questions 1.3 Page No.(31)


1. What is a selection statement?
A programming/algorithm statement that makes a decision. Either one output is run, or a
different one is run.
2. What shape is selection in a flowchart?
A diamond
3. How many arrows come from a selection box in a flowchart, and what is written on each?
Two arrows, one with True (or Yes) and one with False (or No).

4. What are the three parts of a selection statement?


The condition; the action if the condition is true; and the action if the condition is false.

Questions 1.4 Page No.(39)


1. What are the two Boolean values?
True and false (yes or no, 1 or 0, positive or negative).
2. What is the result of True AND True?
True

3. When will a Boolean OR condition give False?


When both conditions are False.
4. What does a Boolean NOT do?
Reverses the Boolean value.
5. When will a Boolean AND condition not give True?
When one or both conditions are False.
1.3 Pattern recognition and sub-routines in flowcharts– page (40)
Key words
Call (a sub-routine): the way that an algorithm accesses a sub-routine.
Efficient: programs that run quicker or use less memory.
Identifier: a name given to sub-routines and variables.
Pattern: a repeated design or sequence.
Pattern recognition: looking at a design or sequence to identify a pattern.
Return: the command that tells a sub-routine to go back to the main code.
Sub-routine: a self-contained algorithm that can be used by other.

Questions 1.5 Page No.(44)


1. What is a pattern?

Something that is repeated, e.g. a colour, text, or design.

2. What is an example pattern in a computer program?

The same background or images used.

3. Why is it important to identify patterns when designing an algorithm?

To save time, because a repeated piece of code only needs to be written and tested once; to
make a program more efficient.

Questions 1.6 Page No.(46)


1. What is the identifier of this sub-routine?
Add Numbers

2. What data is input into this sub-routine?


Two numbers

3. What process takes place in this sub-routine?


The two numbers input are added together.

4. What is output in this sub-routine?


The total of the two numbers added together.

5. What happens when STOP is reached in this sub-routine?


The algorithm returns to where the sub-routine was called in the main code.
Questions 1.7 Page No.(54)
1. What is a sub-routine?
Independent flowchart/algorithm with an identifier. It can be called from other flowcharts/algorithms.
At the end of the sub-routine, the algorithm returns to where it stopped in the main code.

2. What is the flowchart symbol for a sub-routine?

3. What features does a sub-routine have?


An identifier; a stop or return statement.

4. How do you call a sub-routine from another flowchart?


Use its identifier in the sub-routine flowchart symbol which then continues from that same
Place.
5. What happens when a sub-routine comes to the end?
It returns to the algorithm it was called from.

6. Why are sub-routines useful when creating flowcharts?


When the same actions happen several times, you only need to draw one flowchart,

then call it several times. This saves time, and you only need to test the sub-routine once.

1.4 Introduction to text-based programming – page (55)


Key words
Block-based languages: a computer language such as Scratch where you drag blocks to create code
editor.
integrated development environments (IDE): an editor that allows you to run programs.
print: the Python statement that produces output
Syntax: the grammar of the language, or the set of rules that have to be followed.
Syntax errors: mistakes when the set of rules of the language aren’t followed.
Text-based language: a computer language such as Python where you write statements.
Questions 1.8 Page No.(64)
1. What is the command word to output in Python?
print

2. What punctuation do you put around a message in Python to output the message?
Double quotation marks

3. What will be the difference between the output from these two print statements?
print ("Good morning.")
print("good morning!")
The first has a capital G, the second has a lowercase g. The first has a full stop at the end, the second has an
exclamation mark.

4. What is the error in this statement?


print("The sky is blue)
Closing quotation marks are missing.

5. What is the error in this statement?


PRINT("Grass is green")
PRINT should be in lowercase.

6. Write a statement to output your name.


print("Victoria Ellis")

7. Write a Python program to output a list of facts about yourself.


print("I am 11 years old")
1.5 Python programming- page (65)
Key words
Arithmetic operators: addition, subtraction, multiplication and division.
Assignment statement: a statement that stores data in a variable.
Casting: the way to change the data type of a value in Python.
Data type: the format that a data comes in.
Initialising: setting a variable to a starting value.
Input: for the user to enter data.
Reserved word: a word that Python already uses.

Questions 1.9 Page No.(67)


Identify whether each identifier is valid (allowed), or invalid (not allowed) for Python. If it is invalid, state
why.
1. myNumber Valid .

2. 29Value invalid - it starts with a number .

3. My Name. invalid - it has a space and a full stop. .

4. print invalid it is a reserved word .

5. the_Total Valid .

6. Number-entered invalid - it has a hyphen .

Questions 1.10 Page No.(76)


1. Identify the most appropriate data type for each of the items described.
• Number of books that you own, for example: 25: Integer
• Favourite colour, for example: Purple string .
• Amount of money given each week, for example: 2.50 real/float .
• The first letter of your first name, for example: V character .
• Age, for example: 12 integer .
2. Give one example of an Integer number.

Any whole number, e.g. 120

3. Give two examples of data that can be a Character and a String.

Any single characters, e.g. !, V, o


4. What is the difference between an Integer and a Real number?

An Integer is a whole number; a Real number can have a decimal part


5. What is the difference between a String and a Character?

A Character is only one character; a String is one or more characters

Questions 1.11 Page No.(80)


1. What is the command word to read input from the user?
input( )

2. Identify the error in this line of Python code.


input("Enter a colour") = colour

colour = input("Enter a colour")

3. Describe what happens in this program.


first = int(input("Enter a number"))
second = int(input("Enter a number"))
print(first / second)
The program takes two numbers as input from the user, divides the first by the second and
outputs the answer.
1.6 Software development and testing- page (83)
Key words
1. Bug: a logic error in a program
2. Debug: the process of finding and correcting a bug 106 Decrypt: unscramble data to its original form
so that it can be understood.
3. Evaluate: to get an idea of the value of something by carefully looking at and thinking about it.
4. Interface: how you interact with the computer.
5. Logic error: the program has the correct syntax, but there is an error that means the program doesn’t
do what it is supposed to do.
6. Project plan: plans that are used to decide what you are going to and when you are going to it
Prototype: an early version of an end product.
7. Software development: the process where you design, create and test a program.
8. Systematically: working through a process one step at a time.
9. Test plan: a formal way of recording testing.

Questions 1.12 Page No.(87)


1. What is a prototype?

An early/small version of a product or system that might only have some of the features.

2. When evaluating a prototype, what should you compare it to?

The original purpose and/or requirements of the product or system.

3. What should you think about when evaluating a prototype?

Whether the design is suitable; whether the inputs and outputs are appropriate; whether it meets
the requirements; whether it can be improved.

Questions 1.13 Page No.(90)


1. How does planning help you to split work between team members?
To give people tasks that are suitable for them; to make sure everyone has a job.

2. Why is it important to identify deadlines in a plan?

to ensure the project is finished on time.

3. How does putting the tasks in order help the project?

People will not start a task that cannot be completed.


Questions 1.14 Page No.(103)
1. What is a test plan?

A formal description/table that lists all of the ways in which the program will be tested, and what the
output should be.

2. What are the contents of a typical test plan?

A description of what is being tested, the data input and the expected output.

3. Why is it important to plan before testing starts?

To create a record of the tests and the results, to make sure everything is tested and to avoid
repeating the same test(s) multiple times.

Questions 1.15 Page No.(109)


1. What is a syntax error?

Code that does not follow the rules of the programming language.

2. What is a logic error?

Code that runs but does not do what it is supposed to do.

3. How can you find an error in a program?

Read the code line by line and check that it makes sense.

You might also like