Libraries Assessment 2024/2025 Exam
Questions and Answers | A+ Score
Assured
Which code segment results in "true" being returned if a number is even?
Replace "MISSING CONDITION" with the correct code segment.
function isEven(num){
if(MISSING CONDITION){
return true;
} else {
return false;
}
} - 🧠ANSWER ✔✔num % 2 == 0;
Here is the API for a robot library.
COPYRIGHT©PROFFKERRYMARTIN 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE. PRIVACY STATEMENT.
ALL RIGHTS RESERVED
1
, // moves the robot forward
function moveForward();
// turns the robot to the left
function rotateLeft();
// turns the robot to the right
function rotateRight();
// checks if a robot can move in any direction
// direction {string} - the direction to be checked
// return {Boolean} - true if the robot can move in that direction, otherwise
returns false
function canMove(direction);
COPYRIGHT©PROFFKERRYMARTIN 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE. PRIVACY STATEMENT.
ALL RIGHTS RESERVED
2