exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 2 question 5 discussion

Actual exam question from Microsoft's 70-480
Question #: 5
Topic #: 2
[All 70-480 Questions]

HOTSPOT -
You are developing an online shopping application that accepts credit cards for payment.
If the credit card number is invalid, the application must:

Generate an error -
Assign "200" to the error number
Assign "Invalid" to the error description
You need to write the code that meets the requirements.
How should you write the code? (To answer, select the appropriate option from the drop-down list in the answer area.)
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Example: throw new Error(200, "x equals zero");
Reference: throw Statement (JavaScript)

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
SGT
Highly Voted 5 years, 10 months ago
The question is not complete. Answer is: throw new Error (200, "Invalid");
upvoted 8 times
...
Bravo
Most Recent 5 years, 3 months ago
I think the correct answer, in this case, is : throw error(200, "invalid")
upvoted 1 times
...
TonyBezerra
5 years, 6 months ago
There are no options to choose. But i think the right answer is: throw new Error(200, "Invalid");
upvoted 2 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 ...