All challenges
Free Guided

Insurance Premium Calculator

Data Science · Beginner · 50 points · about 120 min · due 20 Nov 2026

Insurance companies calculate premiums based on the amount of coverage, the type of insurance, and the risk associated with the insured person, property, or activity. Incorrect calculations can lead to underpricing or overpricing insurance policies.

In this challenge, you will build an insurance premium calculator that uses provided premium rates and risk factors to calculate the estimated premium payable by a policyholder. The calculator should accept user inputs, validate them, apply the specified calculation rules, and present a clear breakdown of the result.

You will work with a predefined set of insurance rules and sample cases. The objective is to demonstrate how mathematical calculations, conditional logic, and input validation can be used to solve a practical financial problem.

This is an educational simulation, not a model for setting real-world insurance prices.

Start here · about 120 min
  • Review the supplied premium rates and risk-adjustment rules before designing your calculator.
  • Identify the inputs, outputs, and calculation steps required.
  • Write down the formula and work through one sample calculation manually.
  • Plan test cases for normal, boundary, and invalid inputs.
  • Ensure the final output explains how the premium was calculated.

Stuck? Open a hint. Try the first one before the next.

Hint 1

Calculate the base premium before applying the supplied risk adjustments.

Hint 2

Check whether the rules require adjustments to be applied sequentially or independently.

Hint 3

Keep the calculation logic separate from input collection and output presentation where practical.

Hint 4

Use decimal-safe monetary calculations where supported.

Hint 5

Compare your results with manually calculated examples before submitting.

What you'll build

Develop a functional insurance premium calculator that calculates the estimated insurance premium using a supplied coverage amount, base premium rate, and applicable risk factors. The solution must apply the given rules consistently and explain how the final premium was obtained.

Your checklist

  • Accept a coverage amount, a base premium rate, and the risk factors specified in the supplied dataset or challenge instructions.
  • Calculate the base premium using the prescribed formula.
  • Apply the provided risk adjustments correctly, including any applicable discounts or surcharges.
  • Display the base premium, each applicable adjustment, and the final estimated premium.
  • Validate user inputs and reject missing, negative, non-numeric, or otherwise invalid values where inappropriate.
  • Handle boundary cases, including zero coverage where permitted, minimum and maximum allowed values, and combinations of risk factors.
  • Display monetary values consistently to two decimal places.
  • Include at least five test cases covering normal inputs, different risk levels, and invalid inputs.
  • Provide a brief explanation of the calculation formula and the assumptions used.
  • Include clear instructions explaining how to run and test the solution.
  • Use only the rates, adjustment rules, and assumptions supplied for this challenge. Do not invent real-world insurance pricing rules.

Skills you'll practise

Mathematical and financial calculations, Conditional logic and rule implementation, Input validation and error handling, Testing and debugging, Problem-solving, Technical documentation

How it's assessed

A strong submission must demonstrate all of the following:

Calculation accuracy — 30%: Correctly calculates the base premium and applies all supplied risk adjustments.

Risk-factor implementation — 20%: Applies the specified surcharges and discounts in the correct order and according to the supplied rules.

Input validation and error handling — 15%: Identifies invalid inputs and handles boundary cases without producing misleading results.

Testing — 15%: Includes at least five meaningful test cases with expected and actual results.

Output clarity — 10%: Clearly displays the base premium, adjustments, and final premium to two decimal places.

Documentation and usability — 10%: Explains the formula, assumptions, and instructions for running the solution.