exam questions

Exam 98-382 All Questions

View all questions & answers for the 98-382 exam

Exam 98-382 topic 1 question 27 discussion

Actual exam question from Microsoft's 98-382
Question #: 27
Topic #: 1
[All 98-382 Questions]

HOTSPOT -
You are using JavaScript to write a safe root math utility that has the following requirements:
Given the function safeRoot(a, b):
If the radicand (a) is non-negative, return Math.pow (a, 1/b);
Otherwise,
If the index (b) is divisible by 2, then return text indicating the result is imaginary.
Otherwise return -Math.pow (-a, 1/b)
How should you complete the code? To answer, select the appropriate code segments in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
References: https://www.w3schools.com/js/js_if_else.asp

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
becky_intelletive
Highly Voted 4 years, 3 months ago
It's annoying that this question uses the form if (condition) { } else { if (some other condition) { } else {} } instead of using if (condition) { } else if (some other condition) { } else {}
upvoted 7 times
...
dorkian
Most Recent 4 years, 2 months ago
I agree but the correct answer regarding the question is what mentioned.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago