Python (four Formulas)
Individual Homework Assignment
Economic Equivalence
Due date: Sunday, November 27, 2021 @ 11:59 PM
This assignment is an individual assignment and is based on the material covered in Chapter 8:
Economic Considerations and Models.
In Part 3 of the chapter, the primary focus was on the time value of money and the concept of
economic equivalence. For this assignment, you will use computer programming (reference
CSIT 512 Elements of Computer Programming) to implement an economic equivalence
program. Note: CSIT 512 was a prerequisite for IT 514 which is the prerequisite for IT 518.
The slides at the end of Part 3 presented the topic of economic equivalence and provided
example calculations using four variables defined as follows:
P = principle amount in $
F = future amount in $
i or r = interest rate
n = time in years
Given three of the four variables, the unknown value can be found using one of the following
formulas:
To find F: 𝐹 = 𝑃(1 + 𝑖)𝑛
To find P: 𝑃 = 𝐹
(1+𝑖)𝑛
To find n: 𝑛 = 𝑙𝑛(
𝐹
𝑃 )
𝑙𝑛(1+𝑖)
To find i: 𝑖 = ( 𝐹
𝑃 )
1
𝑛 − 1
Write a computer program that implements all four formulas. Write your program in Python
since that is the computer programming language taught in CSIT 512. You will need to import
the Math library for the program. If you wish to use a different language, you must obtain
approval from the professor prior to working on the assignment.
Program specifications:
1. The program must include comments. Comments should be included in the beginning of the
program to identify the programmer and provide a description of what the program does.
Comments should also precede each section of the program containing the formula calculations
that identify the calculation being coded.
2. You may define the known variables in the program or you may obtain them from user input.
There should be a definition of the values or input statements prior to the calculation. For
example, if you are calculating F, the values for i, P and n should immediately precede the
calculation. User input should also follow the same requirement.
3. Verify that each calculation is producing the correct result.
4. The output of each calculation must be printed with appropriate messages. The output should
include the input values and the calculated output.
For example:
The input values were: F = 5000, i = 5, n = 10
The value for P = 3069.56
5. Define appropriate variable names that relate to the value being represented.
Turn in a copy of your source code program and a copy of the output of your program.
Depending on the programming environment you use, the output may be a copy/paste or screen
shot of the content of the output.
Additional note:
For the formulas used to calculate the various unknown values, write the code that would use the
correct numeric value for percentages. The example provided above was to calculate the present
value (P) needed to generate a future amount of $5000 in 10 years at 5% interest. For this
example, whether you prompt the user for input or define the values in the code, the starting
values should be 5000, 10 and 5. Then in your code, you would convert the 5% to 0.05 for the
calculation. If you don't do this, you will get the wrong answer. Do not assume the user will
know to enter the decimal equivalent of the percent value. If I ask a bank what the current
interest is on my savings account, they will tell me in %; e.g. 1%. They won’t say 0.01.