logo

Programming Principles Document

   

Added on  2020-02-24

8 Pages493 Words42 Views
i
Programming Principles
Name
Student ID
Institutional Affiliation
Date
Programming Principles Document_1
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
Programming Principles Document_2
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
Programming Principles Document_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Designing with Python Assignment
|13
|3085
|564