Analysis of Insurance Policy Data and Earnings Calculation

Verified

Added on  2020/02/24

|8
|493
|42
Project
AI Summary
This project focuses on the analysis of insurance policies using Python. It involves calculating earnings based on different policy types (basic, intermediate, and comprehensive), utilizing provided datasets for testing, and demonstrating the program's functionality under both normal and abnormal conditions. The project includes the implementation of a Python program, source code, and output screen captures to illustrate the results. It covers aspects like user input validation, loop structures for repeated calculations, and conditional statements to manage program flow. The analysis also encompasses error handling, specifically addressing scenarios where the program encounters incorrect data types. The project aims to provide a comprehensive understanding of insurance policy analysis and its practical implementation using Python.
Document Page
i
Programming Principles
Name
Student ID
Institutional Affiliation
Date
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
ii
Table of Contents
1. Algorithm 3
2. Test Data 3
a. Normal Function....................................................................................................................3
i. Data Set 1...........................................................................................................................3
ii. Data Set 2...........................................................................................................................4
iii. Data Set 3.......................................................................................................................4
b. Abnormal Functioning...........................................................................................................5
i. Data set 1...........................................................................................................................5
ii. Data Set 2...........................................................................................................................5
3. Source Code for Python Implementation 5
a. Output for three data set when the program is functioning normally....................................6
b. Output when the program is not functioning normally.........................................................7
Document Page
iii
1. Algorithm
Variable setting: basic premium at 500, intermediate premium at 650 and comprehensive
premium at 800
Print output: Enter the following details
User Input: Company name
While loop: Ensures the program runs as long as condition I met
Year
Number of each policies type sold (must be whole numbers)
Computer output: Display earnings from the basic type insurance policy
Display earnings from the intermediate type insurance policy
Display earnings from the comprehensive type insurance policy
Display earnings from the total amount for all the three policies
Functions: Calculates basic insurance earnings
Calculates intermediate insurance earnings
Calculate comprehensive premiums earnings
User input: Choose Y to repeat for another year, N to terminated the program.
If statement: checks if N/Y is chosen
2. Test Data
a. Normal Function
i. Data Set 1
Company
Name
Year Basic Premium Intermediate
Premium
Comprehensive
premium
Jubilee 2013 561 685 2543
Document Page
iv
Program results
Basic Annual Earnings 2013 252450
Intermediate Annual Earnings 2013 400725
Comprehensive Annual Earnings 2013 1830960.000000
Total Annual Insurance Earnings 2484135.0
ii. Data Set 2
Company
Name
Year Basic Premium Intermediate
Premium
Comprehensive
premium
Jubilee 2014 850 230 1400
Program Results
Basic Annual Earnings 382500.0
Intermediate Annual Earnings 134550.0
Comprehensive Annual Earnings 1008000.0
Total Annual Insurance Earnings 1525050.0
iii. Data Set 3
Company
Name
Year Basic Premium Intermediate
Premium
Comprehensive
premium
Jubilee 2015 6003 7450 896
Program Results
Basic Annual Earnings 270135.0
Intermediate Annual Earnings 4358250.0
Comprehensive Annual Earnings 645120.0
Total Annual Insurance Earnings 7704720.0
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
v
b. Abnormal Functioning
The following output is for when the program is given string data i.e. words where it
expects numbers. For instance, the program expects the number of policies sold for each
type to be integers, if a user gives it a float, a double or strings it will exit with an error.
i. Data set 1
Test Data Output
Basic Premium = 2.0 Error: ValueError
ii. Data Set 2
Test Data Output
Basic Premium = Twenty Three Error: ValueError
3. Source Code for Python Implementation
The source code is attached in a separate text file.
Document Page
vi
4. Output Screen Capture
a. Output for three data set when the program is functioning normally
Document Page
vii
b. Output when the program is not functioning normally
Example 1 : Enter a float for the number of insurance policies instead of an integer
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
viii
Example 2: Enter the number of insurance policies in word format
chevron_up_icon
1 out of 8
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]