MUNDO JAVA
sábado, 25 de mayo de 2013
PROGRAMA PARA CREAR UN PLANILLA
package appplanilla; import java.text.DecimalFormat; import java.util.Scanner; public class AppPlanilla { public static void main(String[] args) { Scanner key = new Scanner(System.in); DecimalFormat fmt = new DecimalFormat("#0.00"); int tPlanilla, menu, opc, cont; Float busqueda; menu = 1000; System.out.print("Tamaño Planilla: "); tPlanilla = key.nextInt(); String nombre[] = new String[tPlanilla]; Float sBase[] = new Float[tPlanilla]; Float ventas[] = new Float[tPlanilla]; Float tPagar[] = new Float[tPlanilla]; for (int i = 0; i < tPlanilla; i++) { System.out.print("Nombre: "); nombre[i] = key.next(); System.out.print("Sueldo Base: "); sBase[i] = key.nextFloat(); System.out.print("Ventas del mes: "); ventas[i] = key.nextFloat(); } for (int i = 0; i < tPlanilla; i++) { if (ventas[i] <= 100) { tPagar[i] = (float) (sBase[i] + ventas[i] + (ventas[i] * 0.10)); } else { tPagar[i] = (float) (sBase[i] + ventas[i] + (ventas[i] * 0.20)); } } while (menu == 1000) { System.out.println("\nMenu.-"); System.out.println("-------------------------------"); System.out.println("1.- Imprimir Planilla"); System.out.println("2.- Buscar"); System.out.println("3.- Salir\n"); System.out.print("Opcion: "); opc = key.nextInt(); switch (opc) { case 1: System.out.printf("%s\t%8s%8s%8s\n", "Nombre", "sBase", "Ventas", "tPagar"); System.out.println("--------------------------------------"); for (int i = 0; i < tPlanilla; i++) { System.out.printf("%s\t%8s%8s%8s\n", nombre[i], fmt.format(sBase[i]), fmt.format(ventas[i]), fmt.format(tPagar[i])); } break; case 2: System.out.println("Criterio de busqueda Sueldo.-"); System.out.print("Sueldo mayor o igual a: "); busqueda = key.nextFloat(); System.out.println("Imprimiendo Busqueda.-"); System.out.println("------------------------------------- "); cont = 0; for (int i = 0; i < tPlanilla; i++) { if (tPagar[i] >= busqueda) { System.out.printf("%s\t%8s%8s%8s\n", nombre[i], fmt.format(sBase[i]), fmt.format(ventas[i]), fmt.format(tPagar[i])); cont++; } } if (cont == 0) { System.out.println("\n\tNO HAY REGISTROS!!!.-"); } System.out.println("\nRegistros encontrados: " + cont); break; case 3: menu = -1000; break; default: System.out.println("\nOpcion no Valida.-!!!"); } } } }
0 comentarios:
Publicar un comentario
Entrada antigua
Inicio
Suscribirse a:
Enviar comentarios (Atom)
Follow Us on Twitter!
"Join Us on Facebook!
RSS
Contact
Blogger templates
Libro de visitas de Miguel Eduardo
Nombre:
Direccion E-mail:
como llegaste hasta esta pagina?
Tus comentatios:
Popular Posts
(sin título)
Este programa te compara dos nombres. y te dice sin son iguales o distintos. import java.util.Scanner; public class CadenaDeCaracter...
(sin título)
PROGRAMA UTILIZANDO ARREGLOS QUE PERMITE JUGAR AHORCADO /* * To change this template, choose Tools | Templates * and open the templ...
(sin título)
programa que te pide 2 nombre y edades de la misman y te determida cual es mayor. import java.util.Scanner; public class CadenaDeCa...
(sin título)
Programa que suma,resta,multiplica y divide dos numero ingresado por el Usuario. /* * To change this template, choose Tools | Templ...
(sin título)
programa que pida un número al usuario y que el programa identifique si es Par o Impar. /*b * To change this template, choose Tool...
(sin título)
Sumar el total de los valores de los elementos de un arreglo // Sumar el total de los valores de los elementos de un arreglo. import j...
(sin título)
programa que convierte decimales a binarios. /* * To change this template, choose Tools | Templates * and open the template in the...
(sin título)
Este programa te pide el lado de un cuadrado y te imprime la superficie Scanner teclado=new Scanner(System.in); int la...
(sin título)
Este programa pide el sueldo y te dice que si el suedo es mayor a 200 que abone impuestos de lo contrario manda un mensaje diciendo ("E...
(sin título)
Simulación del lanzamiento de una dado utilizando arreglos / Programa de votación de los estudiantes. import javax.swing.*; public ...
Blogroll
Pages
Página principal
Blog archive
▼
2013
(1)
▼
mayo
(1)
PROGRAMA PARA CREAR UN PLANILLA package a...
►
2012
(17)
►
octubre
(17)
Con la tecnología de
Blogger
.
Translate
Datos personales
Miguel Eduardo Juarez Santos
Ver todo mi perfil
Latest Tweets
;
0 comentarios:
Publicar un comentario