Vous êtes sur la page 1sur 3

MAURICIO NIÑO MONROY

PROGRAMA EMPRESA CON N TRABAJADORES

package interpretacion;
import java.util.Scanner;
public class niño {
private static Scanner dato;

public static void main(String[] args) { // TODO Auto-generated method stub

int Nemple, i=0, NhorasLaboradas, Ntotextras = 0 ;


double Vpe,salario, subtrans, Vppe = 0, salneto = 0, sumpe=0,por = 0,porT=0,
porc=0;

dato = new Scanner(System.in);

System.out.println ("NUMERO DE TRABAJADORES");


Nemple=dato.nextInt();

do{
System.out.println ("DIGITE SU SALARIO");
salario=dato.nextDouble();

System.out.println("NUMERO DE HORAS LABORADAS");


NhorasLaboradas=dato.nextInt();

if ((NhorasLaboradas>0) && (NhorasLaboradas<120))


Vpe=NhorasLaboradas*salario;

else { Vpe=NhorasLaboradas*120; Ntotextras=NhorasLaboradas-120;


Vppe=Ntotextras*(salario*2);}

if (salario<2484348) subtrans=97032;

else { subtrans=0; } salneto=Vpe+Vppe+subtrans;

if(salneto>=4000000) por=1; porT=((por / Nemple)*100);


if(salneto<4000000) porT=0;

System.out.println (" SUBSIDIO " + subtrans);


System.out.println (" HORAS EXTRAS " + Ntotextras );
System.out.println (" PAGO POR HORAS EXTRAS " + Vppe);
System.out.println (" SUELDO NETO " + salneto );
System.out.println (" ");
porc+= porT;
sumpe+= Vppe;
i++;}

while(i<Nemple);

System.out.println ("PAGO TOTAL POR HORAS EXTRAS " + sumpe);


System.out.println (" ");
System.out.println (" EL PORCENTAJE DE TRABAJADORES CON SUELDO MAYOR A 4
MILLONES ES DEL " +porc+ " % " );

return;}}
SICLO WHILE

package interpretacion;
import java.util.Scanner;
public class niño {
private static Scanner dato;
public static void main(String[] args){
// TODO Auto-generated method stub

dato = new Scanner(System.in);

int NV,C=0,PAptas=0;
double piesa,porcentaje,PAp=0;
System.out.print ("Ingresar Numero de VIGAS: ");
NV=dato.nextInt();
while (C<NV) { C=C+1;
System.out.print ("Ingresar la longitud de la VIGA en centimetros "+C+": ");
piesa=dato.nextInt();
if (piesa<=700 && piesa>=650){ PAptas= (PAptas+1); } }
PAp+=PAptas;
porcentaje=(PAp/NV)*100;
System.out.println ("El Numero de VIGAS Aptas es: "+PAptas);
System.out.println ("El porcentaje de VIGAS Aptas es: "+porcentaje+" % ");}}

SICLO FOR

package interpretacion;
import java.util.Scanner;
public class niño {
private static Scanner dato;
public static void main(String[] args) {
// TODO Auto-generated method stub

dato = new Scanner(System.in);

int c=0,NV,C=0,PAptas=0;
double VIGA,PAp=0, porcentaje=0;
System.out.print ("Ingresar Numero de VIGAS: ");
NV=dato.nextInt();

for (C=0;C<NV;C++ ) { c=C+1;


System.out.print ("Ingresar la longitud de la VIGA en centimetros "+c);
VIGA=dato.nextInt();

if (VIGA<=700 && VIGA>=650){ PAptas= (PAptas+1);} }


PAp+=PAptas;

porcentaje=(PAp/NV)*100;

System.out.println ("El Numero de VIGAS Aptas es: "+PAptas);


System.out.println ("El porcentaje de VIGAS aptas es del"+porcentaje+" % ");
} }
SICLO DO WHILE

package interpretacion;
import java.util.Scanner;
public class niño {
private static Scanner dato;
public static void main(String[] args) {
// TODO Auto-generated method stub

dato = new Scanner(System.in);

int c,NV,C=0,PAptas=0;
double VIGA,porcentaje=0,PAp=0;
System.out.print ("Ingresar Numero de VIGAS: ");
NV=dato.nextInt();

do {
c=C+1;
System.out.print ("Ingresar la longitud de la VIGA en centimetros "+c);
VIGA=dato.nextInt();
if (VIGA<=700 && VIGA>=650){ PAptas= (PAptas+1); }C++; }

while(C<NV);PAp+=PAptas;
porcentaje=(PAp/NV)*100;
System.out.println ("El Numero de VIGAS Aptas es: "+PAptas);
System.out.println ("El porcentaje de VIGAS aptas es del : " +porcentaje+"
% "); }}

Vous aimerez peut-être aussi