Está en la página 1de 3

total asrticulos double a1,a2,a3,p,total,cambio; System.out.print("Teclee el precio del primer artuculo"); temporal=lector.readLine(); a1=Integer.parseInt(temporal); System.out.

print("Teclee el precio del segundo articulo"); temporal=lector.readLine(); a2=Integer.parseInt(temporal); System.out.print("Teclee el precio del tercer articulo"); temporal=lector.readLine(); a3=Integer.parseInt(temporal); System.out.print("Teclee el pago"); temporal=lector.readLine(); p=Integer.parseInt(temporal); total=a1+a2+a3; cambio=p-total; System.out.println("Total="+total); System.out.println("Cambio="+cambio); sueldo double ch,sueldo,isr,sueldototal; int ht; ch=2.50; ht=112; sueldo=ht*ch; isr=sueldo*0.07; sueldototal=sueldo-isr; System.out.print ("sueldototal="+sueldototal); MAYOR 3 NUMEROS int a,b,c,d,e,mayor; System.out.print("Teclee el primer numero"); temporal=lector.readLine(); a=Integer.parseInt(temporal); System.out.print("Teclee el segundo numero"); temporal=lector.readLine(); b=Integer.parseInt(temporal); System.out.print("Teclee el tercer numero"); temporal=lector.readLine(); c=Integer.parseInt(temporal); System.out.print("Teclee el cuarto numero"); temporal=lector.readLine(); d=Integer.parseInt(temporal); System.out.print("Teclee el quinto numero"); temporal=lector.readLine(); e=Integer.parseInt(temporal); mayor=0; if((a>b)&&(a>c)&&(a>d)&&(a>e)); {

mayor=a; } if((b>a)&&(b>c)&&(b>d)&&(b>e)); { mayor=b; } if((d>a)&&(d>b)&&(d>c)&&(d>e)); { mayor=d; } if((c>a)&&(c>b)&&(c>d)&&(c>e)); { mayor=c; } if((e>a)&&(e>b)&&(e>c)&&(e>d)); { mayor=e; } System.out.println("Mayor="+mayor);

MENOR 3 NUMEROS int a,b,c,d,e,menor; System.out.print("Teclee el primer numero"); temporal=lector.readLine(); a=Integer.parseInt(temporal); System.out.print("Teclee el segundo numero"); temporal=lector.readLine(); b=Integer.parseInt(temporal); System.out.print("Teclee el tercer numero"); temporal=lector.readLine(); c=Integer.parseInt(temporal); System.out.print("Teclee el cuarto numero"); temporal=lector.readLine(); d=Integer.parseInt(temporal); System.out.print("Teclee el quinto numero"); temporal=lector.readLine(); e=Integer.parseInt(temporal); menor=0; if((a<b)&&(a<c)&&(a<d)&&(a<e)); { menor=a; } if((b<a)&&(b<c)&&(b<d)&&(b<e)); { menor=b; } if((d<a)&&(d<b)&&(d<c)&&(d<e)); { menor=d; } if((c<a)&&(c<b)&&(c<d)&&(c<e)); { menor=c;

} if((e<a)&&(e<b)&&(e<c)&&(e<d)); { menor=e; } System.out.println("Menor="+menor); DOLARES A PESOS double ndolar,tipocambio,pesos; System.out.print("Teclee el primer numero"); temporal=lector.readLine(); ndolar=Integer.parseInt(temporal); System.out.print("Teclee el segundo numero"); temporal=lector.readLine(); tipocambio=Integer.parseInt(temporal); pesos=ndolar*tipocambio; System.out.println(ndolar+"Dolares son"+pesos);

double pesos,tipocambio,dolar; System.out.print("Teclee el numero de pesos"); temporal=lector.readLine(); pesos=Integer.parseInt(temporal); System.out.print("Teclee el tipo de cambio"); temporal=lector.readLine(); tipocambio=Integer.parseInt(temporal); dolar=pesos/tipocambio System.out.println(Peso+" Pesos son "+dolar+" Dolares);

También podría gustarte