MDAS Calculator In C#

MDAS Calculator In C#

MDASCSHARPfig.3

Now, in this tutorial, I will show you how to create MDAS calculator in C#.

MDAS are the four fundamental operations in the calculation which stand for Multiplication, Division, Addition and Subtraction that are very common to remember, sounds good right?

So, if you want to create your own MDAS calculator? These easy steps below will guide you on how to do it.

Let’s begin:

Open Microsoft Visual Studio and create a new windows form application. After that, do the form as follows.

MDASCSHARPfig.1

Go to the solution explorer, hit the “code view” to fire the code editor.

MDASCSHARPfig.2

In the code editor, declare a variable to represent the total of the MDAS.

 double total = 0;

Do the following codes for Multiplication methods.

 private void btnMultiply_Click(object sender, EventArgs e)
 {
 //set a formula for multiplication
 total = double.Parse (txtFinput.Text) * double.Parse (txtSinput.Text);
 //add the answer in the listbox
 lstOutput.Items.Add(double.Parse (txtFinput.Text) + " * " + double.Parse (txtSinput.Text) + " = " + total);
 }

Do the following codes for Division methods.

private void btnDivide_Click(object sender, EventArgs e)
 {
 //set a formula for Division
 total = double.Parse(txtFinput.Text) / double.Parse(txtSinput.Text);
 //add the answer in the listbox
 lstOutput.Items.Add(double.Parse(txtFinput.Text) + " / " + double.Parse(txtSinput.Text) + " = " + total);
 }

Do the following codes for Addition methods.

 private void btnAdd_Click(object sender, EventArgs e)
 {
 //set a formula for addition
 total = double.Parse(txtFinput.Text) + double.Parse(txtSinput.Text);
 //add the answer in the listbox
 lstOutput.Items.Add(double.Parse(txtFinput.Text) + " + " + double.Parse(txtSinput.Text) + " = " + total);
 }

Do the following codes for Subtraction methods.

 private void btnSubtract_Click(object sender, EventArgs e)
 {
 //set a formula for subtraction
 total = double.Parse(txtFinput.Text) - double.Parse(txtSinput.Text);
 //add the answer in the listbox
 lstOutput.Items.Add(double.Parse(txtFinput.Text) + " - " + double.Parse(txtSinput.Text) + " = " + total);
 }

Output:

MDASCSHARPfig.3

Download the Source Code here:

For all students who need a programmer for your thesis system or anyone who needs a source code in any programming languages.

You can contact me @ :

Email – [email protected]
Mobile No. – 09305235027 – TNT

ABOUT PROJECTPROJECT DETAILS
Project Name :MDAS calculator
Project Platform :C#
Programming Language Used:C# Programming Language
Developer Name :itsourcecode.com
IDE Tool (Recommended):Visual Studio 2019
Project Type :Desktop Application
Database:None
Upload Date and Time:June 29, 2016- 7:34 am

Leave a Comment