Answered step by step
Verified Expert Solution
Question
1 Approved Answer
to the simple calculator Instructions To ensure a comprehensive review of your assignment, it is request that you submit your work in PDF format PDF
to the simple calculatorInstructionsTo ensure a comprehensive review of your assignment, it is request that you submit your work in PDF formatPDF Report:Create a PDF document showcasing the proper functionality of your application.Please incorporate screenshots or images within your submission to provide a visual demonstration of yourapplication running seamlessly. Additionally, include code screenshots to ensure a clear and wellcommentedrepresentation of your programming implementation.For this assignment, you need to create a Simple Calculator form. Your job is to design, writecode and include features that handle errors and check if the data entered is valid. You can referto the rubric provided at the end of this assignment for additional guidance.A Adding exception handling to the simple calculatorEntry ErrorDividebyzero error. Please enter a nonzero value for operand Add a trycatch statement in the btnCalculateClick event handler that willcatch any exceptions that occur when the statements in that event handler areexecuted If an exception occurs, display a dialog with the error message, the typeof error, and a stack trace. Test the app by entering a nonnumeric value for one ofthe operands.Add three additional catch blocks to the trycatch statement that will catch aFormatException an OverflowException, and a DivideByZeroException. Thesecatch blocks should display a dialog with an appropriate error message B Add data validation to the simple calculatorIn this part of the assignment, you will add data validation to the Simple Calculator form Code methods named IsPresent IsDecimal and IsWithinRange that work like the methods described in chapter of the book. Code a method named IsOperator that checks that the string value thats passed to it is or Code a method named IsValidOperation that checks for a divide by zero operation This method will need to check the value of the Operand text box and the value of the Operator text box. Code a method named IsValidData that checks that the Operand and Operand text boxes contain a decimal value between and that the Operator text box contains a valid operator, and that the operation is valid. Delete all the catch blocks from the trycatch statement in the btnCalculateClick 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 app to be sure that all the data is validated properly. Document the results in the assignment file
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started