Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MURACH Extra 7-2Add data validation to the simple calculator In this exercise, you'll add data validation to the Simple Calculator form. Open the SimpleCalculator project

MURACH Extra 7-2Add data validation to the simple calculator

In this exercise, you'll add data validation to the Simple Calculator form.

  1. Open the SimpleCalculator project in the Extra Starts\Chapter 07\SimpleCalculatorValidation directory.
  2. Code methods named IsPresent(), IsDecimal(), and IsWithinRange() that work like the methods described in chapter 7 of the book.
  3. Code a method named IsOperator() that checks that the text box that's passed to it contains a value of +, -, *, or /.
  4. 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.
  5. 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.
  6. 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.
  7. Test the application to be sure that all the data is validated properly.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

To add data validation to the Simple Calculator form follow these steps ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

Contact person at the organization

Answered: 1 week ago

Question

Consider the piecewise function

Answered: 1 week ago