To implement a program that calculates compound interest.
Compound interest is the interest calculated on the principal and the interest accumulated over the previous period. It is the most used concept in our daily existence. Compound interest finds its usage in most of the transactions in the banking and finance sectors and other areas. Some of its applications are:
Equation for finding total amount using compound interest is as follow:
Total Amount = P(1+r/100)tp
P = Principal value
tp = Time period for which Principal value is invested in years
r = Rate of interest per annum
The program to compute the compound interest and its equivalent low-level language instructions executed by the hardware are given below:
|It adds the values contained in the register and stores the result in the first register.
|It assigns a value to a variable.
|It divides the values contained in two registers and puts the result in the first register.
|Checks if the condition evaluated to be false.
|Checks if the condition evaluated to true.
|It reads the input from the user and stores it in a variable.
|It increases the value contained in the register by 1.
|Is used to mark the position in the Low-level Language Instructions to enable jumping to the marked position.
|It loads a value of a global or local variable to the given register.
|Lesser than or equal to operator, check whether the first operand is lesser than second operand and return a Boolean value based on the condition.
|It multiplies the values contained in two registers and puts the result in the first register.
|It prints the output value to the screen.
|It stores the value from the given register to the global or local variable.
|Signifies the end of program.
Variables used in the Python program