MKMONEY  Making Money
A trick sometimes used by parents to teach their children the value of money is to give then a penny – just a penny! – and the promise that for each day they don’t spend it, the parent will double it. All students of computing know that long before a month has elapsed without spending a cent, the parents will not likely be able to make good on their promise.
100percent compound daily interest on an investment is, of course, unattainable in normal financial dealings, but we are all continually reminded of the power of compound interest, even with the relatively low interest rates available today.
But exactly how much money can be made with compound interest? Assume, for example, an initial investment of $100.00 (US or Canadian ☺), an annual interest rate of 6.00 percent, and that interest is compounded monthly. That is, the interest earned during the preceding month is added to the principal at the end of the month. (For our purposes, we’ll assume a month is exactly 1/12th of a year.)
At the end of the first month, the money will have earned 0.5 percent interest (1/12th of 6.00 percent), or $0.50. This is added to the $100.00 invested, so that during the next month, interest is paid on $100.50. During the next month another 0.5 percent interest is earned, which is exactly $0.5025. We will assume that the bank, being conservative, will not pay any interest less than $0.01, so our investment is credited with an additional $0.50 at the end of the second month, for a whopping total of $101.00. Continuing in the same manner, at the end of 12 months our investment will total $106.12, $0.12 more than simple 6.00 percent interest for a year with no compounding.
Given an amount P to be invested for a year with I percent interest, compounded C times during the year at equal intervals, what is total return on the investment?
Input
There will be multiple cases to consider. The input for each case is a single line containing the initial investment amount, P, given in dollars and cents (but no fractional cents, and no larger than $100,000.00), the annual interest rate (I) given as a real number with two fractional digits representing a percentage, greater than zero but less than 100, and the number of compounding intervals per year (C), an integer between 1 and 365. The last case will be followed by a line containing “0.00 0.00 0”.
Output
For each input case, display the case number (1, 2, …), the initial investment (P), the annual interest rate (I), the number of compounding intervals per year(C), and the value of the investment at the end of a year. Your output should follow the format shown in the examples below.
Example
Input: 100.00 6.00 1 100.00 6.00 12 1000.00 6.00 12 0.00 0.00 0 Output: Case 1. $100.00 at 6.00% APR compounded 1 times yields $106.00 Case 2. $100.00 at 6.00% APR compounded 12 times yields $106.12 Case 3. $1000.00 at 6.00% APR compounded 12 times yields $1061.63
hide comments
ajayc1007:
20180615 15:15:03
Carefully calculate interest between each compound interest using PEN AND PAPER and detect a pattern ! 

Shashank Singh:
20150112 11:49:26
Please tell mistake in my program


Shashank Singh:
20150112 11:47:26
my output is same as given but still getting wrong answer????? All the manupulations are correct... 

Rishav Goyal:
20140804 06:24:45
BORING .... 

suryasis:
20140318 22:04:09
% is just nt visible............wtf


ABHISHEK004:
20131228 16:09:51
simple.. :)


John Stephanus Peter:
20130717 14:53:42
AC :) Last edit: 20130720 06:48:54 

Himanshu:
20130622 06:59:19
easy one :)


mridul:
20130521 16:45:17
i am getting time excceeded 

Atul Kumar Verma:
20121229 06:39:47
i am getting wrong answer. my output matches sample output.did i miss anything...plzz help.. 
Added by:  Camilo Andrés Varela León 
Date:  20071007 
Time limit:  0.100s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  North Central North America Regional Programming Contest  2003 