double computeSalary (int hours)
if (hours <= 40)
return hours * 8.0;
else if (hours <= 50)
return 320 + (hours - 40) * 12.0;
return 320 + 120 + (hours - 50) * 16.0;
The following sequence of Java statements will print " is a ".
The substring() method prints the characters at each position from start up to but not
including the end position. So the “ ” before “is” is in the fifth position in that
sentence. And the “ ” after “a” is in the tenth position in the sentence.
P1, P1, P2, P3, P3, P4, P5, P5, P1, P1, P5, P5, P1, P1, P5, P1, P1, P1, P1
P1(150K) comes into the second memory space 500K, then the second memory space
left 350K free.
P2 (400K) comes into the forth memory space 600K, then the forth memory space left
P3 (75K) comes into the first memory space 100K, then the first memory space left
P4 (350K) comes into the second memory space 350K, then the forth memory space