-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathImplementaCalc.java
52 lines (44 loc) · 1.24 KB
/
ImplementaCalc.java
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
/*
Carlos Sérgio Pereira Sobrinho
Eliezer Marques da Silva Neto
Humberto Leone Rodrigues Azevedo
Robson Lima de Souza
Rodrigo Borges de Oliveira
Rodrigo da Silva Ribeiro
Yago Magalhães Ávila
*/
import java.rmi.*;
import java.rmi.server.*;
public class ImplementaCalc extends UnicastRemoteObject implements Calculos
{
public int cont = 0;
public ImplementaCalc() throws RemoteException
{
//construtor vazio
}
public float soma(float a, float b) throws RemoteException
{
cont++;
System.out.println("Calculo " + cont + ": " + a + " + " + b + " = " + (a+b));
return a + b;
}
public float subtracao(float a, float b) throws RemoteException{
cont++;
System.out.println("Calculo " + cont + ": " + a + " - " + b + " = " + (a-b));
return a - b;
}
public float multiplicacao(float a, float b) throws RemoteException{
cont++;
System.out.println("Calculo " + cont + ": " + a + " * " + b + " = " + (a*b));
return a * b;
}
public float divisao(float a, float b) throws RemoteException{
cont++;
System.out.println("Calculo " + cont + ": " + a + " / " + b + " = " + (a/b));
return a / b;
}
public int getCont() throws RemoteException
{
return cont;
}
}