Essays.club - Ensayos gratis, notas de cursos, notas de libros, tareas, monografías y trabajos de investigación
Buscar

Programas java while

Enviado por   •  20 de Febrero de 2018  •  698 Palabras (3 Páginas)  •  342 Visitas

Página 1 de 3

...

j++;

}

}

catch (IOException error)

{

System.err.println("Error " + error.getMessage());

}

}

}

EJERCICIO 3

……………………………………………………………………………………………………………..

……………………………………………………………………………………………………………..

……………………………………………………………………………………………………………..

……………………………………………………………………………………………………………..

import java.io.*;

public class Trabajadores

{

public static void main(String args[])

{

InputStreamReader entrada = new InputStreamReader(System.in);

BufferedReader flujoEntrada = new BufferedReader(entrada);

String datoEntrada;

String nombreTra="";

int t, d, totTrab, proDia=0, totProd, totProdGral;

System.out.println("\n PROCESA LA PRODUCCION DE 15 TRABAJADORES\n");

try

{

System.out.println(" REPORTE SEMANAL DE PRODUCCION");

System.out.println("NOMBRE DEL TRABAJADOR UNIDADES PRODUCIDAS");

System.out.println("--------------------------------------------");

totTrab = 0;

totProdGral = 0;

t=1;

while (t

{

System.out.println("\n------------ Entrada de datos ------------");

System.out.print("Teclee nombre: ");

datoEntrada = flujoEntrada.readLine();

nombreTra = datoEntrada;

totProd = 0;

d=1;

while (d

{

System.out.print("Teclee produccion del dia: ");

datoEntrada = flujoEntrada.readLine();

proDia = Integer.parseInt(datoEntrada);

totProd = totProd + proDia;

d++;

}

System.out.println("\n----------------- Salida -----------------");

System.out.println("Nombre = " + nombreTra);

System.out.println("Unidades producidas = " + totProd);

totTrab = totTrab + 1;

totProdGral = totProdGral + totProd;

t++;

}

System.out.println("\n------------------ Total -----------------");

System.out.println("Total trabajadores = " + totTrab);

System.out.println("Total produccion general = " + totProdGral);

}

catch (IOException error)

{

System.err.println("Error " + error.getMessage());

}

}

}

EJERCICIO 4

……………………………………………………………………………………………………………..

……………………………………………………………………………………………………………..

……………………………………………………………………………………………………………..

……………………………………………………………………………………………………………..

import java.io.*;

public class Vendedores3

{

public static void main(String args[])

{

InputStreamReader entrada = new InputStreamReader(System.in);

BufferedReader flujoEntrada = new BufferedReader(entrada);

String datoEntrada;

String nombreVend="";

char otro=' ';

int totVend, dia, mejorDia=0;

float ventaDia, totVenta, totVentaGral, mayorVenta;

System.out.println("\n PROCESA LA VENTA DE VARIOS VENDEDORES\n");

try

{

...

Descargar como  txt (12.4 Kb)   pdf (63.3 Kb)   docx (22.5 Kb)  
Leer 2 páginas más »
Disponible sólo en Essays.club