diff options
| author | mokha <mokha@cisco.com> | 2019-05-08 19:20:31 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2019-05-08 19:20:31 -0600 |
| commit | 45cc3ed51321f3a735ceed7e3394ee3e6ab16af1 (patch) | |
| tree | cee4e78bc52a57e51a448ac237c372397ca38f46 /src/Q2 | |
| parent | 24f849e76ac46ef2a08c3904cecb195e4f7f85af (diff) | |
start program profile for each question
Diffstat (limited to 'src/Q2')
| -rw-r--r-- | src/Q2/README.md | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/Q2/README.md b/src/Q2/README.md new file mode 100644 index 0000000..2335548 --- /dev/null +++ b/src/Q2/README.md @@ -0,0 +1,81 @@ +Learning Profile for Assignment #1, And Question #2 + +Name: Mo Khan +Student ID: 3431709 + +1. Problem Statement: + +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 + +Quarterly minimum: $6,000 +Annual minimum: $24,000 + +Q1: Does not meet quarterly minimum. +Q2: Exceeds quarterly minimum. $7000 * 3% = $210 +Q3: Does not meet quarterly minimum +Q4: Exceeds quarterly minimum. $8000 * 3% = $240. +Y1: $24,000.00 meets the annual minimum. $24,000.00 * 5% = $1,200.00 + +Total bonus: 210 + 240 + 1200 = $1,650.00 + +II. Another employee has committed to save $3000 per month. +His quarterly savings are as follows: + +Q1 – $6000 +Q2 – $9000 +Q3 – $10000 +Q4 – $17000 + +Quarterly min: $9000.00 +Annual min: $36,000.00 + +Q1: does not meet quarterly min. +Q2: $9,000 * 3% = $270.00 +Q3: $10,000 * 3% = $300.00 +Q4: $17,000 * 3% = $510.00 +Y1: $42,000.00 saved. $42,000.00 * 5% = $2,100.00 + +42,000 - 36,000 = $6,000 * 25% = $1,500.00 + +Total: $270.00 + $300.00 + $510.00 + $2,100.00 + $1,500.00 +$4,680.00 + + +Write a program to compute the total bonus amount earned by these two employees in the year. + +```ruby +class BonusOnSavings + def compute_bonus(commitment, q1, q2, q3, q4) + end +end +``` + +2. Description of the Code: + +[Briefly describe how you solved the problem in your code. You should include short description of classes, methods, and variables (if necessary) that you used in your code.] + +3. Errors and Warnings: + +[Please enlist your Errors and Warnings (maximum five) that you encountered in your code and how you solved them. An example of this is shown in Table 1.] +Table 1: List of Errors and Warnings Encountered in the Program + + +4. Sample Input and Output: +[Provide some test cases with sample input and output of your program.] + +5. Discussion: + +[In this section, you may include some discussion about the debugging strategy that you used, e.g., searched the Web for a solution, contacted tutor, solved by self, used a debugging tool, posted in forum, talked to a friend, etc.] |
