TAREA2
TAREA2
CORRIDA
package tarea2;
import java.util.Scanner;
public class TAREA2 {
opc = teclado.nextLine();
switch (opc) {
case "a":
case "A": divisiones(); break;
case "b":
case "B": sumar(); break;
case "C": restar(); break;
case "d":
case "D": multiplicaciones(); break;
case "e":
case "E": System.out.println();
System.out.println("Gracias por usar la aplicación.
Vuelva Pronto");
}
}while(!opc.equalsIgnoreCase("E"));
}
}
}
package tarea2;
public class calculos {
//atributos//
private int num1;
private int num2;
}
//metodos/
public int suma(){
int suma = this.num1 + this.num2;
return suma;
}
public int resta(){
int resta = this.num1 - this.num2;
return resta;
}
public int multiplicacion(){
int multiplicacion = this.num1 * this.num2;
return multiplicacion;
}
public double division(){
double division = (double)this.num1 / (double)this.num2;
return division;
}