The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
HOMEWORK # 3
In this HW are will be adding extra GUI controls and functionality to HW # 2.
First, your calculator should be fully functional. This means that it should be able to
accomplish all arithmetic operations on any set of numbers. The number buttons should be
fully active and implemented. The user cannot edit the display what so ever and the cursor
should not be displayed (google how to do this OR use a Label instead of a TextBox)
If the input is 3 then + then 5 then = and then + then 4. Your calculator should display 12.
This means your calculator should be able to append other operations and operands on
results.
Next, your calculator should be able to convert between binary and decimal. You are only
required to do conversation and not binary arithmetic. In order to do this your will need to
add two radio buttons to your form that give the user the option to pick if he/ she want to
be in Decimal (default - startup) or binary mode.
This is an example of how your controls should / may look like
The binary mode is used solely to convert a number from Decimal to Binary and visaversa. Example: if the user enters the number 10 in decimal mode and then selects the
binary mode then 1010 should be displayed. If the user enters 101 while in binary mode
and then selects the decimal mode then the number 5 should be displayed. Make sure you
disable all non-necessary control elements when in binary mode. You need to write a
method for converting binary into decimal and another method to convert from decimal to
binary. (do not use built in method /API)
Hereis an example I found on the web to convert from decimal to binary
http://www.wikihow.com/Convert-from-Decimal-to-Binary
Hereis an example for converting from binary to decimal
http://www.wikihow.com/Convert-from-Binary-to-Decimal
Finally. Your calculator should respond to keyboard key press (just like the calculator for
windows). So if someone presses the number 1 on the keyboard; this will mean that the
button with number 1 has been clicked and the display will show the number 1. If the * sign
is pressed on the keyboard; it should act as if the * button is clicked and if the enter button
is pressed on the keyboard then it acts just like if the “=” is clicked.
Hereis a link from MSDN that provides with the means on how to do this. Read it carefully.
http://msdn.microsoft.com/en-us/library/ms171538.aspx
I have attached my fully working calculator except with the add ons I need. I am having trouble doing this. I am new to C# and programming so I need help! THanks
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;namespaceWindowsFormsApplication2{publicpartialclassForm1:Form{stringinput =string.Empty;stringoperand1 =string.Empty;stringoperand2 =string.Empty;charoperation;doubleresult = 0.0;publicForm1(){InitializeComponent();}privatevoidone_Click(objectsender,EventArgse){this.textBox1.Text ="";input +="1";this.textBox1.Text += input;}privatevoidtwo_Click(objectsender,EventArgse){this.textBox1.Text ="";input +="2";this.textBox1.Text += input;}privatevoidthree_Click(objectsender,EventArgse){this.textBox1.Text ="";input +="3";this.textBox1.Text += input;}privatevoidfour_Click(objectsender,EventArgse){this.textBox1.Text ="";input +="4";this.textBox1.Text += input;}
Attachments: