Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions Calculadora.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package Calculadora;

/**
*
* @author notedj
*/
public class Calculadora {
private double resultado;

public Calculadora() {
this.resultado = resultado;
resultado =0;
}

public double somarDoisNumeros(double a ,double b){
resultado = a+b;
return resultado;
}
public double subtrairDoisNumeros(double a, double b){

resultado = a-b;

return resultado;

}

public boolean ePar(int a){
return a % 2 == 0;
}

public boolean eImpar(int a){
return a % 2 !=0 ;
}





}
18 changes: 18 additions & 0 deletions Teste.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package Calculadora;

/**
*
* @author notedj
*/
public class Teste {
public static void main(String[] args) {
Calculadora teste = new Calculadora();

teste.somarDoisNumeros(2.0, 3.0);

System.out.println(teste.somarDoisNumeros(2.0, 3.0));


}

}
1 change: 1 addition & 0 deletions calculadora.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ def eh_par(a):

def eh_impar(a):
return not eh_par(a)