Question

C# Calculator

So I've got the form for the most part.

BUT I need to see the buttons programmed to actually work.

I also need a read only text box that updates as you enter values to keep track of whats being entered.

And lastly the calculator must understand order of operations to solve a long problem in the right order. Would greatly appreciate help! Would love to see someones version of this to dissect.

Calculator 8 / 7 CE 4 5 1 2 3 0 X

0 0
Add a comment Improve this question Transcribed image text
Answer #1

private void n1_Click(object sender, EventArgs e)  {  

    if (textBox1.Text == "0" && textBox1.Text != null)  

    {  

        textBox1.Text = "1";  

    }  

    else  

    {  

        textBox1.Text = textBox1.Text + "1";  

    }  

}  

private void n2_Click(object sender, EventArgs e)  

{  

    if (textBox1.Text == "0" && textBox1.Text != null)  

    {  

        textBox1.Text = "2";  

    }  

    else  

    {  

        textBox1.Text = textBox1.Text + "2";  

    }  

}  

  

private void n3_Click(object sender, EventArgs e)  

{  

    if (textBox1.Text == "0" && textBox1.Text != null)  

    {  

        textBox1.Text = "3";  

    }  

    else  

    {  

        textBox1.Text = textBox1.Text + "3";  

    }  

}  

  

private void n4_Click(object sender, EventArgs e)  

{  

    if (textBox1.Text == "0" && textBox1.Text != null)  

    {  

        textBox1.Text = "4";  

    }  

    else  

    {  

        textBox1.Text = textBox1.Text + "4";  

    }  

}  

  

private void n5_Click(object sender, EventArgs e)  

{  

    if (textBox1.Text == "0" && textBox1.Text != null)  

    {  

        textBox1.Text = "5";  

    }  

    else  

    {  

        textBox1.Text = textBox1.Text + "5";  

    }  

}  

  

private void n6_Click(object sender, EventArgs e)  

{  

    if (textBox1.Text == "0" && textBox1.Text != null)  

    {  

        textBox1.Text = "6";  

    }  

    else  

    {  

        textBox1.Text = textBox1.Text + "6";  

    }  

}  

  

private void n7_Click(object sender, EventArgs e)  

{  

    if (textBox1.Text == "0" && textBox1.Text != null)  

    {  

        textBox1.Text = "7";  

    }  

    else  

    {  

        textBox1.Text = textBox1.Text + "7";  

    }  

}  

private void n8_Click(object sender, EventArgs e)  

{  

    if (textBox1.Text == "0" && textBox1.Text != null)  

    {  

        textBox1.Text = "8";  

    }  

    else  

    {  

        textBox1.Text = textBox1.Text + "8";  

    }  

}  

private void n9_Click(object sender, EventArgs e)  

{  

    if (textBox1.Text == "" && textBox1.Text != null)  

    {  

        textBox1.Text = "9";  

    }  

    else  

    {  

        textBox1.Text = textBox1.Text + "9";  

    }  

}  

  

private void n0_Click(object sender, EventArgs e)  

{  

    textBox1.Text = textBox1.Text + "0";  

}  

Add a comment
Know the answer?
Add Answer to:
C# Calculator So I've got the form for the most part. BUT I need to see the buttons programmed to actually work. I a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hello, I am having trouble with part c of this question. Here is my work so far: The solution for part c states that a...

    Hello, I am having trouble with part c of this question. Here is my work so far: The solution for part c states that a possible solution is (e^16 * 4^3) / 3! I am having trouble understanding how they got e^16 or why they decided to use e^(4^2) for M in the equation |f(x) - Tn(x)| <= (M / (n + 1)!) * |x - 0|^(n + 1). From my understanding, I have to maximize H^3(x) (i.e. 3rd derivative...

  • I really need help with filling out the data table for part two. I've completed the...

    I really need help with filling out the data table for part two. I've completed the table for part one of the experiment. I really need help with filling out the data table for part two. I've completed the table for part one of the experiment. Procedure IMPORTANT SAFETY CONSIDERATIONS: Avoid getting NaOH on your skin. Should you come in contact with this chemical, immediately wash with water. Review all MSDS associated with this lab. Any broken or chipped glassware...

  • Hello I need help with this program. Should programmed in C! Program 2: Sorting with Pointers...

    Hello I need help with this program. Should programmed in C! Program 2: Sorting with Pointers Sometimes we're given an array of data that we need to be able to view in sorted order while leaving the original order unchanged. In such cases we could sort the data set, but then we would lose the information contained in the original order. We need a better solution. One solution might be to create a duplicate of the data set, perhaps make...

  • Use only the Excel functions (no calculator). I need to see all Excel formulas to give...

    Use only the Excel functions (no calculator). I need to see all Excel formulas to give you a full credit. Give answers to the 4th decimal place. 1. (Sheet #1) (10 points) Use the following categorical frequency distribution to answer each problem. a. (4 pts) Create a pie chart and pareto chart. b. (3 pts) Add two more columns: Relative Frequency (rf) and Cumulative Relative Frequency (crf). Calculate rf and crf. c. (1 pt.) Find a mean. d. (1 pt.)...

  • Need help with a C++ problem I have

    For my assignment I have to write a program that creates a restaurant billing system. I think that I got it correct but it says that it is incorrect, so I was wondering if someone would be able to look over my code. It says that I need tax of $0.20, and the amount due to be $4.10, which is what I have in my output.https://imgur.com/a/jgglmvWMy issue is that I have the correct outcome when I run my program but...

  • Would someone help me with the last 3 questions here, I got the previous ones but need help with the last 3 in red. Than...

    Would someone help me with the last 3 questions here, I got the previous ones but need help with the last 3 in red. Thank you Transcribed: Now that you nd a rst order system of ODEs, you can solve it using the Huens method ac- cording to the material you covered in computational module 2. A template of the code which will help you to get started is also available. Attach the complete code as a pdf page to...

  • *URGENT JAVA PROGRAMMING LAB* so I need to write some classes for my lab if someone...

    *URGENT JAVA PROGRAMMING LAB* so I need to write some classes for my lab if someone could give me an outline or just how I should so it that would be awesom here is the questions please help ASAP A. A histogram is used to plot tabulated frequencies. Create a Histogram class that can be used to maintain and plot the frequencies of numbers that fall within a specified range. The Histogram class contain will an array of counters with...

  • Need C programming help. I've started to work on the program, however I struggle when using...

    Need C programming help. I've started to work on the program, however I struggle when using files and pointers. Any help is appreciated as I am having a hard time comleting this code. #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_LINE 100 #define MAX_NAME 30 int countLinesInFile(FILE* fPtr); int findPlayerByName(char** names, char* target, int size); int findMVP(int* goals, int* assists, int size); void printPlayers(int* goals, int* assists, char** names, int size); void allocateMemory(int** goals, int** assists, char*** names, int size);...

  • hi..please help..so i took a test and i got all of it wrong and im not...

    hi..please help..so i took a test and i got all of it wrong and im not sure how to do this problems..this is Investment class..please explain every step because im going to study using this material.thank you Fall 2010 4. Compare and contrast open end ve closed-end mutual funds will sell as long you want to buy the share, management comparin thom to you, while closed end mutual funds Preferred stocks on any public traced securities such as cquity, bond...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT