{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

homework# 3 for cse

# homework# 3 for cse - [Type text 1 double computeSalary(int...

This preview shows pages 1–2. Sign up to view the full content.

[Type text] 1. double computeSalary (int hours) { if (hours <= 40) { return hours * 8.0; } else if (hours <= 50) { return 320 + (hours - 40) * 12.0; } else { return 320 + 120 + (hours - 50) * 16.0; } } 2. 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. 3. Time quantum=2 P1, P1, P2, P3, P3, P4, P5, P5, P1, P1, P5, P5, P1, P1, P5, P1, P1, P1, P1 4. First-Fit: 100K P3 500K P1,P4 200K 600K P2 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 200K free. P3 (75K) comes into the first memory space 100K, then the first memory space left 25K free. P4 (350K) comes into the second memory space 350K, then the forth memory space

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 3

homework# 3 for cse - [Type text 1 double computeSalary(int...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online