public class Calculadora {
public static void main(String []agrs)
{
Scanner in=new Scanner(System.in);
int op=0;
double n1,n2,s,m,d,r,p,me,ma;
do{
System.out.print(" Calculadora \n");
System.out.print("[1] SUMAR\n");
System.out.print("[2] RESTAR\n");
System.out.print("[3] MULTIPLICAR\n");
System.out.print("[4] Modulo\n");
System.out.print("[5]Promedio\n");
System.out.print("[6]Mayor\n");
System.out.print("[7] SALIR\n");
System.out.print("Ingresa una opcion:");
op=in.nextInt();
switch(op)
{
case 1:
System.out.print("Ingrese numero 1:");
n1=in.nextDouble();
System.out.print("Ingrese numero 2:");
n2=in.nextDouble();
s=n1+n2;
System.out.print("La suma es:"+s);
break;
case 2:
System.out.print("Ingrese numero 1:");
n1=in.nextDouble();
System.out.print("Ingrese numero 2:");
n2=in.nextDouble();
r=n1-n2;
System.out.print("La resta es:"+r);
break;
case 3:
System.out.print("Ingrese numero 1:");
n1=in.nextDouble();
System.out.print("Ingrese numero 2:");
n2=in.nextDouble();
m=n1*n2;
System.out.print("La multiplicacion es:"+m);
break;
case 4:
System.out.print("Ingrese numero 1:");
n1=in.nextDouble();
System.out.print("Ingrese numero 2:");
n2=in.nextDouble();
d=n1/n2;
System.out.print("La division es:"+d);
break;
case 5:
System.out.print("Ingrese numero 1:");
n1=in.nextDouble();
System.out.print("Ingrese numero 2:");
n2=in.nextDouble();
p=(n1+n2)/2;
System.out.print("La division es:"+p);
break;
case 6:
}
}while(op!=5);
}
}