How should you write the code?

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.)

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.)

A.



Leave a Reply 14

Your email address will not be published. Required fields are marked *


pablo

pablo

answer is throw-Error-200-Invalid

Rohit

Rohit

are you sure this is the correct answer?

Chris

Chris

pablo is right

jason

jason

Pablo is right, I tried this out in VS.NET 2012

Candidate

Candidate

throw new Error(“Invalid”, 200); also works

Rucha

Rucha

throw new Error(200,”Invalid”);
This is the correct option for the exam from html5 point of view.

Candidate

Candidate

but in misrosoft site provided example
throw new Error(200, “x equals zero”);

clem

clem

you must make (200, “error”), this is for IE. For all other browsers it’s (“error, 200) but because it’s microsoft’s exam I suggest to use the IE’s one 🙂

Cherroud

Cherroud

try {
throw new Error(200, “x equals zero”);
}
catch (e) {
document.write(e.message);
}

Google

Google

Here are some hyperlinks to sites that we link to due to the fact we believe they may be worth visiting.

Google

Google

One of our visitors not long ago proposed the following website.

Play Games Online Free

Play Games Online Free

always a large fan of linking to bloggers that I really like but really don’t get quite a bit of link appreciate from

curso de retrospectiva animada

curso de retrospectiva animada

Sites of interest we’ve a link to