MCQ Test 2
- Question 11:
- Question 12:
- Question 14:
- Question 15:
- Question 21:
- Question 27:
- Question 30:
- Question 32:
- Question 33:
- Question 45:
- Question 49:
Total Score: 39/50
Question 11:
The answer is A since the value of input A is true which means the value from the OR gate is true, since the final outfut is true the value of input B didn’t affect the result
Question 12:
The answer is B since both conditions don’t need to be satisfied in order for the elevator to work since the elevator needs to be on a different floor from which it’s called
Question 14:
The answer is A since the output is true making it so that the input value of A must be true in order for that to occur
Question 15:
The answer is D since it requires the robot to rotate left in order to reach the goal but it will rotate right since it comes before rotate left
Question 21:
The answer is D since it’s an infinite loop since i is set to one every code is looped making it so that it never reaches i=4
Question 27:
The answer is D since it’s the only option that increases the distance the robot moves horizontally while keeping the vertical distance traveled the same
Question 30:
The answer is B and C instead of C and D since the circles all have the same x-position of 4 and it’s only the y-position and radius changing
Question 32:
The answer is C since program 1 the value of i starts at 1 and finishes at n so that result has the sum of all values from 1 to n while in program 2 the value of i starts at n and finishes at 1 so that result has the sum of all values from n to 1 which makes both o fthem have the correct sum
Question 33:
The answer is C since in algorithm 1 the max value would be -1 and not change while in algorithm 2 the inital would have a max of -7 but change the max value in all cases returning the correct max value
Question 45:
The answer is C since heuristic is any approach to problem solving that is practical but isn’t guaranteed to be optimal but is sufficient for reaching an immediate or short-term goal
Question 49:
The answer is D since some problems, such as determining if any program will eventually stop, cannot be solved by an algorithm