Operations on numeric and Boolean data
Click on the option which you think is the best answer to the question.
Question 1
When the program below was run, the number 1.6 was printed.The code that should be written in the line beginning Z = is...
X = 5
Y = 8
Z = Print Z
Z = X / Y
Z = X * Y
Z = Y / X
Z = X + Y
When the program below was run, the number 1.6 was printed.The variable Z has a data type of...
X = 5
Y = 8
Z = Y / X
Print Z
Character
Question 2
Integer
String
Real
A Real data type.
Question 3
A variable which can have either of the two values True or False has...
An Integer data type.
A Boolean data type.
A String data type.
0
Look at the following code that checks if a person is old enough to drive.
legalAge = 17
Input age
bool canDrive = (age >= legalAge)
Print canDrive
If a user inputs their age as 17 then the expected output would be...
False
1
True
Question 4
A Boolean expression results in a value of either true or false.Complex boolean expressions use operators to combine simpler expressions.
Look at the expression below:
( score >= 69 && score <= 90)
The operator && makes the expression return the true value...
If either side is true (or if both are true).
Question 5
If both sides are false.
Only if both sides are true.
If either side is false (or if both are false).