Autorun Virus Remover v2.3 Build 0702, Protection through your USB
Thursday, July 2, 2009
Computer Architecture: A Quantitative Approach, David Patterson (McGraw-Hill)
Appendix E .- Overview of RISC architectures
public Main () {l1 = new Label
("Number 1");
t1 = new TextField (8);
l2 = new Label ("Number 2"); t2 = new TextField (8); b1 = new Button ("Sum"); b2 = new Button ("Subtract"); b3 = new Button ("Multiply");
b4 = new Button ("Divide");
b5 = new Button ("Root 1");
b6 = new Button ( "Root 2");
b7 = new Button ("More"); l2 = new Label ("Number 2"); t2 = new TextField (8); b1 = new Button ("Sum"); b2 = new Button ("Subtract"); b3 = new Button ("Multiply");
b4 = new Button ("Divide");
b5 = new Button ("Root 1");
b6 = new Button ( "Root 2");
b8 = new Button ("Clear"); L3 = new Label ("Results");
T3 = new TextField (8); add (L1); add (t1); add (l2);
add (T2);
add (B1);
add (B2);
add (B3);
add (B4);
add (B5);add (B7);
add (B6);
add (B8);
add (L3); add
(T3);b1. addActionListener (this);
B2. addActionListener (this); B3. addActionListener (this);
b4. addActionListener (this); B5. addActionListener (this); B6. addActionListener (this); b7. addActionListener (this); B8. addActionListener (this);}
public void actionPerformed (ActionEvent ae) {if
(ae.getSource () == b1) {int n1 = Integer.parseInt (t1.getText ());
int n2 = integer . parseInt (t2.getText ()); int sum = 0; sum = n1 + n2;
t3.setText ("" + sum);} if (ae.getSource () == b2) {
int n1 = Integer.parseInt (t1.getText ()); int n2 = Integer.parseInt (t2.getText ());
RESTA int = 0; t3.setText ("" + sum);} if (ae.getSource () == b2) {
int n1 = Integer.parseInt (t1.getText ()); int n2 = Integer.parseInt (t2.getText ());
RESTA = n2 - n1; t3.setText ( + RESTA)
} if (ae.getSource () == B3) {int n1 = Integer.parseInt (t1.getText ()); int n2 = Integer.parseInt (t2.getText ()); multi
int = 0;
multi = n1 * n2; int = 0;
t3.setText ("" + multi);} if (ae.getSource () == b4) {int n1 = Integer.parseInt
(t1.getText ()); int n2 = Integer.parseInt (t2. getText ()); int div = 0;
div = n1 / n2;
t3.setText ("" + div);}
if (ae.getSource () == b5) {int n1 =
Integer.parseInt (t1.getText ());
double root = 0;
root = Math.sqrt (n1); t3.setText ("" + root);
} if (ae.getSource () == b6) {int n2 = Integer.parseInt (t2.getText ()) ; double root = 0;
root = Math.sqrt (n2); t3.setText ("" + root);
} if (ae.getSource () == b7) {int n1 = Integer . parseInt (t1.getText ());
int n2 = Integer.parseInt (t2.getText ()); int higher = 0;
if (n1> n2) = n1 higher;
div = n1 / n2;
t3.setText ("" + div);}
if (ae.getSource () == b5) {int n1 =
Integer.parseInt (t1.getText ());
double root = 0;
root = Math.sqrt (n1); t3.setText ("" + root);
} if (ae.getSource () == b6) {int n2 = Integer.parseInt (t2.getText ()) ; double root = 0;
root = Math.sqrt (n2); t3.setText ("" + root);
} if (ae.getSource () == b7) {int n1 = Integer . parseInt (t1.getText ());
int n2 = Integer.parseInt (t2.getText ()); int higher = 0;
if (n1> n2) = n1 higher;
else higher = n2; t3.setText ("" + highest);
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment