Computers & Internet Logo

Related Topics:

Posted on Dec 15, 2008

How to create owr own calculater - Computers & Internet

1 Answer

Anonymous

Level 1:

An expert who has achieved level 1.

Hot-Shot:

An expert who has answered 20 questions.

Corporal:

An expert that has over 10 points.

Mayor:

An expert whose answer got voted for 2 times.

  • Contributor 20 Answers
  • Posted on Dec 15, 2008
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

Hot-Shot:

An expert who has answered 20 questions.

Corporal:

An expert that has over 10 points.

Mayor:

An expert whose answer got voted for 2 times.

Joined: Dec 15, 2008
Answers
20
Questions
0
Helped
6230
Points
40

For all os ? you must use java language! this is the code:

//<applet code="calmayank"height=300 width=300></applet>
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class calmayank extends JApplet
implements ActionListener
{
JTextField t1;

JButton b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,
b11,b12,b13,b14,b15,b16,b17,b18,b19,b20;

GridLayout gl;
JPanel p1,p2,p3;

public void init()
{
gl=new GridLayout(5,4);
p1=new JPanel();
p2=new JPanel();
p3=new JPanel();
p1.setLayout(gl);
t1=new JTextField(17);
b1=new JButton("1");
b2=new JButton("2");
b3=new JButton("3");
b4=new JButton("4");
b5=new JButton("5");
b6=new JButton("6");
b7=new JButton("7");
b8=new JButton("8");
b9=new JButton("9");
b10=new JButton("0");
b11=new JButton("+");
b12=new JButton("-");
b13=new JButton("*");
b14=new JButton("/");
b15=new JButton("@");
b16=new JButton("$");
b17=new JButton("%");
b18=new JButton(".");
b19=new JButton("?");
b20=new JButton("=");


p2.add(t1);

p1.add(b1);
p1.add(b2);
p1.add(b3);
p1.add(b4);
p1.add(b5);
p1.add(b6);
p1.add(b7);
p1.add(b8);
p1.add(b9);
p1.add(b10);
p1.add(b11);
p1.add(b12);
p1.add(b13);
p1.add(b14);
p1.add(b15);
p1.add(b16);
p1.add(b17);
p1.add(b18);
p1.add(b19);
p1.add(b20);
p3.add(p2);
p3.add(p1);
getContentPane().add(p3);

b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
b6.addActionListener(this);
b7.addActionListener(this);
b8.addActionListener(this);
b9.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
t1.setText("1");
}
else if(e.getSource()==b2)
{
t1.setText("2");
}
else if(e.getSource()==b3)
{
t1.setText("3");
}
else if(e.getSource()==b4)
{
t1.setText("4");
}
else if(e.getSource()==b5)
{
t1.setText("5");
}
else if(e.getSource()==b6)
{
t1.setText("6");
}
else if(e.getSource()==b7)
{
t1.setText("7");
}
else if(e.getSource()==b8)
{
t1.setText("8");
}
else if(e.getSource()==b9)
{
t1.setText("9");
}
}
}

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

0helpful
1answer

Pls help me to get zte mf 920 v code calculater

I want to unlock my MF 920V Hotspot Airtel..
Give me the code
0helpful
1answer

Coffee overflows when brewing

make sure carafe is pushed in all the way.We had to tape owrs every morning
1helpful
1answer

I have a qustion about the casio fx-300es calculater. I am taking a state exam and calculaters that are programable, have alphbets and make sound are not allowed. Does this calculater have any of these...

The Fx-300ES does not have any of the nifty features you are not allowed to have. You cannot program it=non programmable. It does not have a QWERTY keyboard and it is totally mute.
It does have a few variables that can be used to store values (A, B,C,D,E, X,Y but I believe that does not disqualify it.
You may want to check your state's exam website for a list of allowed calculators.
0helpful
1answer

Casio fx-9860G graphics calculater, vertical line segment

I am not sure how you can create such function (the range limitation do not work for x=c) but you can draw a vertical segment, just do not call it a function.

Draw a graph Y1=0
Then press SKETCH function key and use the F6 key to cycle through the TABS at the bottom of the screen. Look for the TAB named PEN. and click the function key below it.

Use the arrows to move the cursor to a spot on the screen (near the bottom), Press EXE to fix the starting point of the segment. Then use the Up arrow to draw a vertical segment from bottom to top.
0helpful
1answer

How to create a simple calculater and requeired code

Hello,
pgrm:
Loop
Create a few registers
ClrSC
Prompt : enter a or a letter to exit
Read string1
If string1 NOT numeric exit
Move a to reg1
Prompt: enter b or a letter to exit
Read string2
If string2 NOT a number exit
Move b to reg2
Prompt : enter operation sign
Read opsign
If
opsign(0) Display a opsign b
else if
print:
I have not been programmed to carry out illegal operations. Try gain
end if
pool (end loop)
end

Can you implement that in the language of your choice.
3helpful
1answer

What batteries go in a TI-35 Plus calculater

I went to Office Max and they told me for FREE what batteries go in my old calculater.
10helpful
2answers

Steps to refresh my nokia3110c

MY NOKIA 3110C HAVE SOME PROB. LIKE CALCULATER VANISHED, DEFAULT THEMS, TONES, WALPAPERS ARE VANISHED AND I HAVE ONE ANOTHER PROB. WHEN I OPEN THE MSGS THEN PHONE RESTART
1helpful
2answers

Userguide for sigmatel s98

plg tell me now how to connect my mobile in owr pc sigmatel s 98
0helpful
1answer

Calculater application

you will have to take the phone and ahve the firmware reflash to get back the calculator application.
Not finding what you are looking for?

263 views

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Grand Canyon Tech
Grand Canyon Tech

Level 3 Expert

3867 Answers

Brad Brown

Level 3 Expert

19187 Answers

Cindy Wells

Level 3 Expert

6688 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...