{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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,
Image of page 1

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern