473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help im doing a calculator

i already did the calculator but theres 2 text box for the addition and another 2 for the sub etc. whats the code so that i only need one text box and whatever you write there it solves it (ex. 2 *2 or 2-2).
Sep 27 '06 #1
2 1535
CaptainD
135 100+
i already did the calculator but theres 2 text box for the addition and another 2 for the sub etc. whats the code so that i only need one text box and whatever you write there it solves it (ex. 2 *2 or 2-2).
You just need to add a third component to tell the code what to do with the values in the two text boxes.

Look at Microsofts calculator. It uses command buttons. One for +, one for - etc. And they only use one text box. I assume they hold there values in either variables and/or arrays then display back the results.

you can do the same thing.
Sep 27 '06 #2
Reena83
32
You just need to add a third component to tell the code what to do with the values in the two text boxes.

Look at Microsofts calculator. It uses command buttons. One for +, one for - etc. And they only use one text box. I assume they hold there values in either variables and/or arrays then display back the results.

you can do the same thing.
Hi, are you still having problems. I have a calculator program its so simple and all in good working order. Just send me an email. And Ill help you out...
Reena
Sep 28 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Sean McCourt | last post by:
Hi I am doing a JavaScript course and learning from the recommed book (JavaScript 3rd Edition by Don Gosslin) Below is one of the exercises from the book. I get this error message when I try to...
4
by: mwh | last post by:
Hi. If you remember, I posted Expressons Help. Now I am making a calculator with javascript. I can't get this to work: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"...
6
by: Rafael | last post by:
Hi Everyone, I need some help with my calculator program. I need my program to do 2 arguments and a 3rd, but the 3rd with different operators. Any help would be great. Here is my code.... ...
4
by: mak1084 | last post by:
import javax.swing.*; import java.awt.event.*; public class Calculator extends JFrame { public Calculator() { JButton jBtn1=new JButton("1");
3
by: mandy335 | last post by:
public class Calculator { private long input = 0; // current input private long result = 0; // last input/result private String lastOperator = ""; // keeps track of...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.