70-483 question 176 discussion


You are creating a console application named App1.
App1 will validate user input for order entries.
You are developing the following code segment (line numbers are included for reference

You need to complete the code segment.
The solution must ensure that prices are positive and have two decimal places.
Which code should you insert at line 03?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Created 4 months, 1 week ago by kalmusr


^(-)? doesn't ensure that the price is positive. My choice is answer C


Correct Answer is C. IsMatch is not a static method, and price must be positive to be valid.


No there is static method available


Validated in VS. C is the correct answer


No, C is not the correct answer because isMatch takes up 2 parameters as indicated at the bottom of the green description.


Correct answer is C, see "https://msdn.microsoft.com/de-de/library/3y21t6y4(v=vs.110).aspx" with example


Only C ensures that the value is positive, but none of them ensures that prices have (exactly) two digits. Remember ? means _zero_ or one times. "^\d+(\.\d\d){1}$" would work with answer C.