wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz: Programming a Calculator. Part 1 and Part 2 Review

Total questions: 17

Worksheet time: 9mins

Name
Class
Date
1.

What does the word 'variable' mean?

a)

box

b)

changeable

c)

movable

d)

random

2.

What does a 'syntax' error message tell you might be wrong with your code?

a)

I have typed something wrong or missed something out (e.g. commas, brackets, capital letters)

b)

I have too much or not enough space at the stat of the line.

c)

I have given a variable name incorrectly

d)

I have tried to use the wrong type of data

3.

What does a 'type' error message tell you might be wrong with your code?

a)

I have typed something wrong or missed something out (e.g. commas, brackets, capital letters)

b)

I have too much or not enough space at the stat of the line.

c)

I have given a variable name incorrectly

d)

I have tried to use the wrong type of data

4.

What does a 'name' error message tell you might be wrong with your code?

a)

I have typed something wrong or missed something out (e.g. commas, brackets, capital letters)

b)

I have too much or not enough space at the stat of the line.

c)

I have given a variable name incorrectly

d)

I have tried to use the wrong type of data

5.

What does a 'indentation' error message tell you might be wrong with your code?

a)

I have typed something wrong or missed something out (e.g. commas, brackets, capital letters)

b)

I have too much or not enough space at the stat of the line.

c)

I have given a variable name incorrectly

d)

I have tried to use the wrong type of data

6.

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

a)

shape

b)

height

c)

weight

d)

first name

e)

body mass index.

7.

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

a)

triangle

b)

height

c)

shape

d)

base

e)

area

8.

True or False?


Computers are intelligent.

a)

True

b)

False

9.

True or False?


Computers work through a program one line of code at a time

a)

True

b)

False

10.

True or False?


Computers use + just for adding numbers

a)

True

b)

False

11.

True or False?


Computers use + for adding numbers or for joining text strings together

a)

True

b)

False

12.

True or False?


Computers use x for multiplying numbers

a)

True

b)

False

13.

True or False?


Computers use * for multiplying numbers

a)

True

b)

False

14.

Look at the following code


firstname=input("Enter your firstname)


This will give a syntax error because:

a)

there is a missing bracket

b)

ther is a missing speech mark

c)

it wont, it will work fine

d)

the variable name is wrong

e)

the command 'input' has been typed wrong

15.

Look at the following code


firstname=Input("Enter your firstname")


This will give a syntax error because:

a)

there is a missing bracket

b)

ther is a missing speech mark

c)

it wont, it will work fine

d)

the variable name is wrong

e)

the command 'input' has been typed wrong

16.

Look at the following code


firstname=Input("Enter your firstname")

print fistname


This will give a name error because:

a)

there is a missing bracket

b)

there is a missing speech mark

c)

it wont, it will work fine

d)

the variable name is wrong

e)

the command 'input' has been typed wrong

17.

Look at the following code


length=(int(input("Enter a number")

print ("Your number was: ") + length


This will give a syntax error because:

a)

there is a missing bracket

b)

you can't join (concatenate) a string (str) and integer (int)

c)

it wont, it will work fine

d)

the variable name is wrong

e)

the command 'input' has been typed wrong