{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cse-110-homework-3

# cse-110-homework-3 - P2 P3 P4 P5 all at time 0 Describe how...

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

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,

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.

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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern