cse-110-homework-3 - P2, P3, P4, P5, all at time 0....

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

View Full Document Right Arrow Icon
Name: Student ID # CSE 110 Homework 3 Due: Friday, April 1, at 11:59 PM, via Blackboard. This assignment is worth a total of 12 points. You must show all work in order to receive any credit for your solutions. 1. Complete the computeSalary() method below, which calculates and returns an employee's weekly pay based on the rules below. (2 points) a. The normal pay rate for an employee is $8.00 per hour. b. Employees are paid at their normal rate up to and including 40 hours. c. Hours past 40 but below 51 are paid at 150% of the normal rate. d. Hours past 50 are paid at 200% of the normal rate. double computeSalary (int hours) { } 2. Given the Java String variable assignment String sentence = "This is a sample sentence"; what will the following sequence of Java statements print? Explain why Java will print this result. (2 points) String x = sentence.substring(4, 10); System.out.println(x); 3. Consider the set of processes in the table on the right: The processes are assumed to have arrived in the order P1,
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: P2, P3, P4, P5, all at time 0. Describe how these processes will be executed using round-robin (RR) scheduling, with a time quantum of 2. (2 points) Process Execution Time P1 10 P2 1 P3 2 P4 1 P5 5 4. Assume that a computer s memory is broken up into the following partitions (in the order given), and that we have the following list of programs to be loaded: 100K Process Name Memory Needed P1 150K P2 400K 500K P3 75K P4 350K 200K 600K BrieFy describe how the irst-it, Best-it, and Worst-it algorithms would load these programs into memory. (2 pts each) 5. EXTRA CREDIT: Consider the following sequence of disk I/O requests: 83, 38, 75, 15, 61, 65, 47, 99, 38, 23 Assume that the read/write head starts at position 50. How far will the head move to handle all of these requests using a shortest-seek-time-rst (SST) strategy? (3 pts)...
View Full Document

This note was uploaded on 09/14/2011 for the course CSE 110 taught by Professor Shaunakpawagi during the Spring '08 term at SUNY Stony Brook.

Page1 / 2

cse-110-homework-3 - P2, P3, P4, P5, all at time 0....

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online