Font size
WorksheetsQuiz: Programming a Calculator. Part 1 and Part 2 Review
Total questions: 17
Worksheet time: 9mins
What does the word 'variable' mean?
box
changeable
movable
random
What does a 'syntax' error message tell you might be wrong with your code?
I have typed something wrong or missed something out (e.g. commas, brackets, capital letters)
I have too much or not enough space at the stat of the line.
I have given a variable name incorrectly
I have tried to use the wrong type of data
What does a 'type' error message tell you might be wrong with your code?
I have typed something wrong or missed something out (e.g. commas, brackets, capital letters)
I have too much or not enough space at the stat of the line.
I have given a variable name incorrectly
I have tried to use the wrong type of data
What does a 'name' error message tell you might be wrong with your code?
I have typed something wrong or missed something out (e.g. commas, brackets, capital letters)
I have too much or not enough space at the stat of the line.
I have given a variable name incorrectly
I have tried to use the wrong type of data
What does a 'indentation' error message tell you might be wrong with your code?
I have typed something wrong or missed something out (e.g. commas, brackets, capital letters)
I have too much or not enough space at the stat of the line.
I have given a variable name incorrectly
I have tried to use the wrong type of data
Look at this problem:
Write a program that asks the user to input their age, height and weight.
Your program should calculate the user's body mass index.
Age is one variable we would need to use. Tick all the options below that we would need as variables for this program
shape
height
weight
first name
body mass index.
Look at this problem:
Write a program that asks the user to input the base and height of a triangle.
Your program should calculate the triangle's area.
Tick all the options below that we would need as variables for this program
triangle
height
shape
base
area
True or False?
Computers are intelligent.
True
False
True or False?
Computers work through a program one line of code at a time
True
False
True or False?
Computers use + just for adding numbers
True
False
True or False?
Computers use + for adding numbers or for joining text strings together
True
False
True or False?
Computers use x for multiplying numbers
True
False
True or False?
Computers use * for multiplying numbers
True
False
Look at the following code
firstname=input("Enter your firstname)
This will give a syntax error because:
there is a missing bracket
ther is a missing speech mark
it wont, it will work fine
the variable name is wrong
the command 'input' has been typed wrong
Look at the following code
firstname=Input("Enter your firstname")
This will give a syntax error because:
there is a missing bracket
ther is a missing speech mark
it wont, it will work fine
the variable name is wrong
the command 'input' has been typed wrong
Look at the following code
firstname=Input("Enter your firstname")
print fistname
This will give a name error because:
there is a missing bracket
there is a missing speech mark
it wont, it will work fine
the variable name is wrong
the command 'input' has been typed wrong
Look at the following code
length=(int(input("Enter a number")
print ("Your number was: ") + length
This will give a syntax error because:
there is a missing bracket
you can't join (concatenate) a string (str) and integer (int)
it wont, it will work fine
the variable name is wrong
the command 'input' has been typed wrong
