You are on page 1of 4

import java.io.

*; public class Algoritmos { public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamRe ader(System.in)); int opc; String temp = new String(); boolean resp; do { System.out.println("-----------Men Algoritmos----------"); System.out.println("1. Algoritmo calcular salari o."); System.out.println("2. Algoritmo calcular salari o ms horas extra."); System.out.println("3. Algoritmo calcular descue nto de sueldo neto."); System.out.println("4. Algoritmo calcular descue nto segn el monto."); System.out.println("5. Algoritmo calcular segund os restantes para el minuto."); System.out.println("6. Algoritmo calcular das, ho ras y minutos desde segundos."); System.out.println("7. Algoritmo calcular suma d e N primeros naturales."); System.out.println("8. Algoritmo crear informe n otas estudiante."); System.out.println("9. Algoritmo calcular suma d e dgitos."); System.out.println("10. Algoritmo emitir factura ."); System.out.println("11. Algoritmo determinar par es, impares, positivos y negativos."); System.out.println("12. Algoritmo calcular facto rial."); System.out.println("13. Algoritmo calcular prome dio de 100 nmeros."); System.out.println("14. Algoritmo calcular recib o de la luz."); System.out.println("Terminar Programa (cualquier otro nmero)."); System.out.println("Por favor selecciona una opc in"); temp = br.readLine(); opc = Integer.parseInt(temp); resp = chooseMenu(opc); } while(resp); } private static boolean chooseMenu(int opc) throws IOException{ boolean resp = false; switch(opc) { case 1 : algoritmo1(); resp = true; break; case 2 : algoritmo2(); resp = true; break; case 3 : algoritmo3();

resp = true; break; case 4 : algoritmo4();//implementado resp = true; break; case 5 : algoritmo5();//implementado resp = true; break; case 6 : algoritmo6(); resp = true; break; case 7 : algoritmo7(); resp = true; break; case 8 : algoritmo8(); resp = true; break; case 9 : algoritmo9(); resp = true; break; case 10 : algoritmo10(); resp = true; break; case 11 : algoritmo11(); resp = true; break; case 12 : algoritmo12(); resp = true; break; case 13 : algoritmo13(); resp = true; break; case 14 : algoritmo14(); resp = true; break; default : break; } System.out.println("\n\n\n Espera unos segundos...");try { Thread.sleep(3000); } catch(InterruptedException e) { //no s ehace nada } return resp; } private static void algoritmo1(){ //copiar cdigo hecho } private static void algoritmo2(){ //copiar cdigo hecho } private static void algoritmo3(){ //copiar cdigo hecho }

private static void algoritmo4() throws IOException{ String monto = new String(); BufferedReader br = new BufferedReader(new InputStreamRe ader(System.in)); System.out.println("Por favor ingresa el monto del cul qu ieres calcular el descuento."); monto = br.readLine(); double valor = Integer.parseInt(monto); if (valor >0 && (valor < 100 || valor == 100)){ valor -= valor*0.02; System.out.println("El valor menos el descuento del 2% es: "+valor); } else { if (valor > 100) { valor -= valor*0.1; System.out.println("El valor menos el de scuento del 10% es: "+valor); } else System.out.println("Lo siento el valor n o es vlido."); } } private static void algoritmo5() throws IOException{ String segundos = new String(); BufferedReader br = new BufferedReader(new InputStreamRe ader(System.in)); System.out.println("Por favor ingresa los segundos."); segundos = br.readLine(); int valor = Integer.parseInt(segundos); double aux = valor/60; if( (valor/60)*60 == valor ){ System.out.println("Los segundos: "+valor+" son exactamente: "+(valor/60)+" minutos"); } else { System.out.println("Al valor ingreado le faltan: "+((valor/60)-aux)+"segundos para ser: "+valor/60+" minutos"); } } private static void algoritmo6() throws IOException{ } private static void algoritmo7() throws IOException{ } private static void algoritmo8() throws IOException{ } private static void algoritmo9() throws IOException{ }

private static void algoritmo10() throws IOException{ } private static void algoritmo11() throws IOException{ } private static void algoritmo12() throws IOException{ } private static void algoritmo13() throws IOException{ } private static void algoritmo14() throws IOException{ } }

You might also like