Create a windows form application in C# that looks and functions
like a basic calculator. It...
90.2K
Verified Solution
Link Copied!
Question
Programming
Create a windows form application in C# that looks and functionslike a basic calculator. It must do the following:
Add, subtract, multiply, and divide.
Account for division by zero.
Show at least two decimal places.
Retain the last number on the window so that, when the useropens the calculator the next time, the number that was in thewindow at the last close appears.
Have a memory, so that users can store values and recallthem.
Operate with a mouse clicking buttons
Operate from the keyboard only with no mouse requirement.
Contain a small box for a company logo. Make up a logo andinsert it there.
Contain a clear and clear all button.
The user must not be able to enter data directly in the displaywindow – they have to press the keys.
Look like a calculator, and not a maximized window.
Use naming conventions for all the elements on the form. Inother words, do not use the default names for the labels, buttons,or other controls.
Answer & Explanation
Solved by verified expert
4.0 Ratings (837 Votes)
using System using SystemCollectionsGeneric using SystemComponent Model using SystemData using SystemDrawing using SystemText using SystemWindowsForms namespace Calculator public partial class Form1 Form double FirstNumber string Operation public Form1 InitializeComponent private void n1Clickobject sender EventArgs e if textBox1Text 0 textBox1Text null textBox1Text 1 else textBox1Text textBox1Text 1 private void n2Clickobject sender EventArgs e if textBox1Text 0 textBox1Text null textBox1Text 2 else textBox1Text textBox1Text 2
See Answer
Get Answers to Unlimited Questions
Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!
Membership Benefits:
Unlimited Question Access with detailed Answers
Zin AI - 3 Million Words
10 Dall-E 3 Images
20 Plot Generations
Conversation with Dialogue Memory
No Ads, Ever!
Access to Our Best AI Platform: Zin AI - Your personal assistant for all your inquiries!