summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormokha <mokha@cisco.com>2019-04-28 14:18:02 -0600
committermokha <mokha@cisco.com>2019-04-28 14:18:02 -0600
commited2d1efd395b62b7f94808cc0690a841e8dc858a (patch)
treed3a1792c36e800695dd2a2cf6e7629530da186cc
parentcc37d0383d79f2529a30c6495c560b9841c97e9f (diff)
add Assignment 1, question 2.
-rw-r--r--assignments/assignment1/README.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/assignments/assignment1/README.md b/assignments/assignment1/README.md
index 13b2b57..e873bc0 100644
--- a/assignments/assignment1/README.md
+++ b/assignments/assignment1/README.md
@@ -22,3 +22,36 @@ Assume that name1 and name2 follow the following format: "FirstName M. LastName"
Test your program for correct, partially correct (e.g., name string without the middleName),
and incorrect inputs (e.g., phone number containing special characters).
+
+
+2. Space Inc. will give a quarterly and annual bonus to its employees only if the savings of the quarter and/or
+the year are greater than or equal to quarterly minimum (monthly commitment x 3) and/or the annual minimum (monthly commitment x 12) amount, respectively.
+
+The quarterly bonus is 3% of eligible quarterly savings, and the annual bonus is 5% of annual savings if eligible.
+If the annual savings exceeds the committed amount by at least 25%, Space Inc. matches the additional savings (25% or above) as part of the annual bonus.
+
+I. An employee has committed to save $2000 per month.
+
+Her quarterly savings are as follows:
+
+Q1 – $5000
+Q2 – $7000
+Q3 – $4000
+Q4 – $8000
+
+II. Another employee has committed to save $3000 per month.
+His quarterly savings are as follows:
+
+Q1 – $6000
+Q2 – $9000
+Q3 – $10000
+Q4 – $17000
+
+Write a program to compute the total bonus amount earned by these two employees in the year.
+
+```ruby
+class BonusOnSavings
+ def computeBonus(commitment, q1, q2, q3, q4)
+ end
+end
+```