Write a program to calculate the insurance premium for building (house) insurance. The premium depends on the amount insured and also has a processing charge of $50. Customers are charged 0.3% of the amount insured, where the insured amount is less than $100,000, and 0.25% for other amounts. Customers that have zero claims receive a 10% reduction in their total premium as a no claim bonus. The amount insured is always a multiple of $1000.
Run Amount Insured ($) ? 50000 Number of claims ? 2 Premium Summary Amount Insured = $50000 Number of claims = 2 Premium = $200.00 Run Amount Insured ($) ? 50000 Number of claims ? 0 Premium Summary Amount Insured = $50000 Number of claims = 0 No claim bonus = $20.00 Premium = $180.00 Run Amount Insured ($) ? 100000 Number of claims ? 5 Premium Summary Amount Insured = $100000 Number of claims = 5 Premium = $300.00 Run Amount Insured ($) ? 100000 Number of claims ? 0 Premium Summary Amount Insured = $100000 Number of claims = 0 No claim bonus = $30.00 Premium = $270.00 Run Amount Insured ($) ? 200000 Number of claims ? 1 Premium Summary Amount Insured = $200000 Number of claims = 1 Premium = $550.00 Run Amount Insured ($) ? 200000 Number of claims ? 0 Premium Summary Amount Insured = $200000 Number of claims = 0 No claim bonus = $55.00 Premium = $495.00
The assignment should be word processed with each page numbered. Suggested left margin 2.5cm, right margin a minimum of 1cm.
The following sections are required, (in his order).
This should contain:
This must contain:
The work will not be marked without a signed statement of authorship.
The code should:
Copy the code from Access and paste it into your word processed document.
The code listing should:
You must include a statement indicating whether the code listed successfully compiled (no syntax errors).
Example statement: "The code listed below compiled successfully." or "The code listed below did NOT compile."
You runs must be made using the program listed in the previous section. You must include a statement indicating that the program runs are for your program as listed in the previous section.
Example statement: "The program runs below are the output of the program listed in the previous section."
| Test Number | Reasons | Inputs | Expected Results | Actual Results | Correct? |
|---|---|---|---|---|---|
| 1 | Amount insured well under $100,000. Low value in 0.3% bracket | amountInsured = 20000 numberOfClaims = 0 |
noClaimBonus = 11 premium = 99 |
||
| 2 | Amount insured just under $100,000. Maximum in 0.3% bracket | amountInsured = 99000 numberOfClaims = 2 |
premium = 347 | ||
| 3 | Amount insured $100,000. Minimum in 0.25% bracket | amountInsured = 100000 numberOfClaims = 1 |
premium = 300 | ||
| 4 | Amount insured well over $100,000. High value in 0.25% bracket | amountInsured = 5000000 numberOfClaims = 0 |
noClaimBonus = 1255 premium = 11295 |
||
| 5 | No claim bonus in 0.3% bracket. See test #1 | ||||
| 6 | No claim bonus in 0.25% bracket. See test #4 | ||||
| 7 | Not eligible for no claim bonus in 0.3% bracket. See test #2 | ||||
| 8 | Not eligible for no claim bonus in 0.25% bracket. See test #3 |
The following is a guide to the marks assigned to each section of the assignment.
| Section Name | Percentage of Marks |
|---|---|
| Presentation | 5% |
| Defining Diagram | 10% |
| Pseudo Code | 35% |
| Data Dictionary | 5% |
| Desk Check | 10% |
| Access Basic Code | 25% |
| Test Plan & Runs | 10% |
Written by Tim Whitfort.