My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 1 attachment: Calculadora.java (1.5 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package Calculador.Modelo;
/**
*
*
* @author user
*/
public class Calculadora {
private double num1;
private double num2;
private double resp;
private String operacion;
private double memoria;

public Calculadora(){

}
public double sumar(double n1,double n2){
setResp(n1 + n2);

return getResp();
}
public double restar(double n1,double n2){
setResp(n1 - n2);
return getResp();
}
public double multiplicar(double n1,double n2){
setResp(n1 * n2);
return getResp();
}
public double dividir(double n1,double n2){
setResp(n1 / n2);
return getResp();
}
public double raiz(double n1){
resp=Math.sqrt(n1);
return resp;
}
public static void main(String[] args) {

}

public double getResp() {
return resp;
}

public void setResp(double resp) {
this.resp = resp;
}

public double getNum1() {
return num1;
}

public void setNum1(double num1) {
this.num1 = num1;
}

public double getNum2() {
return num2;
}

public void setNum2(double num2) {
this.num2 = num2;
}

public String getOperacion() {
return operacion;
}

public void setOperacion(String operacion) {
this.operacion = operacion;
}

public double getMemoria() {
return memoria;
}

public void setMemoria(double memoria) {
this.memoria = memoria;
}

}
Powered by Google Project Hosting