Homework 1 Criteria, Page 3 of 4
[p5] 12 points
Given the following code:
if (num_1 > num_2) ___ (num_2 < num_3) then
print (“I”)
else if (num_3 >= num_1) then
print (“LOVE”)
else
print (“Computing”)
endif
What would be printed if:
a) num_1 is 12, num_2 is 15, num_3 is 32, and ___ is AND?
b) num_1 is 2, num_2 is -1, num_3 is 2, and ___ is OR?
c) num_1 is 3, num_2 is 4, num_3 is 5, and ___ is XOR?
d) num_1 is 2, num_2 is 2, num_3 is 2, and ___ is AND?
[c5] 12 points
-3 (x4) for each incorrect answer (wra)
[p6] 20 points
Write an algorithm to do the following:
0. Prompt the user for two numbers
1. Read in two numbers
2. Compute the sum of the numbers
3. Print the sum of the numbers
4. If the sum is greater than 1000 print “Wow, that’s a big number”; otherwise, print
“That number isn’t too big”