Arithmetic operators Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are arithmetic operators used for?

A

to specify how values are to be manipulated

to perform calculations in algorithms and programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

(OCR pseudocode)

+

A

addition

e.g. 13 + 9 = 24

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

(OCR pseudocode)

-

A

subtraction

e.g. 24 - 12 = 13

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

(OCR pseudocode)

*

A

multiplication

e.g. 6 * 9 = 54

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

(OCR pseudocode)

/

A

division

e.g. 36 / 5 = 5.2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

(OCR pseudocode)

MOD

A

modulus division

Returns the remainder after the division of one number by another

e.g. remainder = number MOD 2

number / 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

(OCR pseudocode)

DIV

A

Quotient division
Returns the quotient/lowest integer/whole number

e.g. 11 DIV 4 = 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

(OCR pseudocode)

A

Exponential powers of

e.g. 3 ^ 3 = 27

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Order of operations

A

the order of operations needs to be followed in a calculation

Brackets
Indices or powers
Division
Multiplication
Addition
Subtraction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A chocolate factory worker puts 20 bars into each box.

Write an algorithm to calculate and output the number of full boxes produced in a day. [2]

A
numberOfBars = input ("Enter number of bars produced.")
numberOfBoxes = numberOfBars DIV 20

print(numberOfBoxes + “full boxes have been produced.”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Wife an algorithm in pseudocode that would allow a user to:

  • input the number of items sold by a shop each day for three days
  • calculate the total number of items sold
  • calculate the mean number of items sold each day as an integer. [3]
A
day1 = input ("Please enter number sold on day 1")
day2 = input ("Please enter number sold on day 2")
day3 = input ("Please enter number sold on day 3")
total = day1 + day2 + day3
meanSold = total DIV 3
How well did you know this?
1
Not at all
2
3
4
5
Perfectly