Trabajadores y horas de trabajo:

package trabajadores;

/**
*
* @author Administrador
*/
import java.io.*;
public class Main {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int n_t;
int n;
int cont=1;
String nom= «»;
n_t=Leer.datoInt(«Numero de trabajadores: «);
while(cont <= n_t){
nom=Leer.datoString("Nombre: ");
n=Leer.datoInt("Horas de trabajo: ");
print_tra(nom,hour(n));
cont+=1;
}

}
public static int hour(int n){
int res=n*250;
return res;
}

public static void print_tra(String nom, int res){
System.out.println("Nombre: "+ nom);
System.out.println("Sueldo: $"+ res +".00");
}
}