Question: in C# in visual studio In this exercise, youll add data validation to the Simple Calculator form. Open the SimpleCalculator project in the Extra StartsChapter

in C# in visual studio

In this exercise, youll add data validation to the Simple Calculator form.

Open the SimpleCalculator project in the Extra Starts\Chapter 07\SimpleCalculatorValidation directory.

Code methods named IsPresent(), IsDecimal(), and IsWithinRange() that work like the methods described in chapter 7 of the book. in C# in visual studio In this exercise, youll add data validation

Code a method named IsOperator() that checks that the text box thats passed to it contains a value of +, -, *, or /.

Code a method named IsValidOperation() that checks for a divide by zero operation. This method will need to check the Operand 2 text box and the value of the Operator text box.

Code a method named IsValidData() that checks that the Operand 1 and Operand 2 text boxes contain a decimal value between 0 and 1,000,000, that the Operator text box contains a valid operator, and that the operation is valid.

Delete all of the catch blocks from the try-catch statement in the btnCalculate_Click() event handler except for the one that catches any exception. Then, add code to this event handler that performs the calculation and displays the result only if the values of the text boxes are valid.

Test the application to be sure that all the data is validated properly.

Operand 2: Result: Operand 2: Result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!