sid's
Would you like to react to this message? Create an account in a few clicks or log in to continue.

sid's

OPen Discussion
 
HomePortalSearchLatest imagesRegisterLog in

 

 problem occur~

Go down 
AuthorMessage
sujun06




Posts : 1
Join date : 2008-02-22

problem occur~ Empty
PostSubject: problem occur~   problem occur~ Icon_minitimeThu Mar 20, 2008 1:21 am

harlo demo~ i hav question abt group assignment 2 question 2.


public class EmployeesNeeded{
public static void main(String [] args){
int[] customers = new int [336];
for(int k=1;k<15;k++){
for(int i =0; i<=customers.length; i++){
for(int j=1;j<25;j++){
System.out.println("Please enter numbers of customers each hours for 14 days: ");
customers[i]=MyInput.readInt();
}}}
System.out.println("Days\t\tHours\t\tCustomers per Hours\t\tEmployees Needed");
System.out.println("--------------------------------------------------------");
for(int k=1;k<15;k++){
for(int i =0; i<=customers.length; i++){
for(int j=1;j<25;j++){
System.out.println(k+"\t\t"+j+"\t\t"+customers[i]+"\t\t"+employeesper20(customers));
}}}
}
public static int employeesper20(int[] array){
int finalneed=0;
for(int i=0; i<=array.length;i++){
int need=array[i]/20;
if(need<=3)
finalneed=3;
else
finalneed=need;
}
return finalneed;
}
}


then when i run it, it jst nonstop to obtain data.
can u plz help me to figure out whats wrong with it?
thx a lot~
Back to top Go down
 
problem occur~
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
sid's :: TEACHING MATERIAL :: UPM-SAK3100-
Jump to: