Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A4-E1 Simple Calculator In this exercise, youll create a form that accepts two operands and an operator from the user and then performs the requested

A4-E1 Simple Calculator

In this exercise, youll create a form that accepts two operands and an operator from the user and then performs the requested operation.

1.Start a new project named SimpleCalculatorin the Assignment4\SimpleCalculator directory.

2. Add labels, text boxes, and buttons to the default form and set the properties of the form and its controls so they appear as shown above.

a.When the user presses the Enter key, the Click event of the Calculate button should fire (event is generated).

b.When the user presses the Esc key, the Click event of the Exit button should fire.

3. Code a private method named Calculate that performs the requested operation and returns a decimal value. This method should accept the following arguments:

Argument Description

decimal operand1 The value entered for the first operand.

string operator1 One of these four operators: +, -, *, or /.

decimal operand2 The value entered for the second operand.

4. Create an event handler for the Click event of the Calculate button. This event handler should get the two numbers and operand the user enters,

a.call the Calculate method to get the result of the calculation,

b.display the result rounded to four decimal places,

c.and move the focus to the Operand 1 text box.

5. Create an event handler for the Click event of the Exit button that closes the form.

6. Create an event handler that clears the Result text box if the user changes the text in any of the other text boxes.image text in transcribed

a Simple Calculator X Operand 1 86 Operator: Operand 2 11.11 7.7408 Result: Calculate

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago