{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cse-110-homework-4-answer-k - Name Student ID CSE 110...

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

Name: Student ID # CSE 110 Homework 4 — ANSWER KEY Due: Friday, December 3, at the beginning of class, on paper. 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 50 are paid at 150% of the normal rate. d. Hours past 50 are paid at 200% of the normal rate. double computeSalary (int hours) { if (hours <= 40) // 0.5 point for this case { return hours * 8.0; } else if (hours <= 50) // 0.5 point for this case { return 320 + (hours - 40) * 12.0; } else // 1.0 point for this case { return 320 + 120 + (hours - 50) * 16.0; } }

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

View Full Document
2. Consider the grammar S ( L ) S a L L , S L S Draw a parse tree for the sentence ( a , ( a
This is the end of the preview. Sign up to access the rest of the document.
• Fall '08
• SHAUNAKPAWAGI
• IP address, AirTrain Newark, 600K partition, 500K partition, 350K free partition, initial 100K partition

{[ snackBarMessage ]}

Page1 / 3

cse-110-homework-4-answer-k - Name Student ID CSE 110...

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

View Full Document
Ask a homework question - tutors are online