Hi everyone, basically the problem i have is; when the program loops around for the 2nd, 3rd etc it resorts the swip back to the inital value of 1000, rather than what i want it to, the ewip from the previous day. I have underlined/highlighted the two bits i mean. For example after the first loop Ewip =5, then i want the swip for the next day to equal this number rather than 1000
int x = 0;
while (x < 10)
{ x++; //Loops 10 times
int endwip, sentnum, counter;
int startwip = 500;//Given it a value higher than can be taken
counter =0;//Given it a value otherwise system thinks it won;t be initialised
Random dice = new Random();
for(int counter=0; counter<1;counter++){
counter= 1+dice.nextInt(6);} //Creates a random number to be passed along
workstation ws = new workstation(number);
sentnum=counter;//Sent numner = Dice roll
endwip= startwip -sentnum; //Calculates the EWIP, which will be the next turns SWIP
startwip = endwip-counter;//Give the SWIP a value for the next turn
System.out.println("new swip " + swip);
}
}