4324 - 금융: 월복리

Time Limit: 1s Memory Limit: 128MB

Submissions: 939 Solved: 597
Description

당신은 연이율 5%를 제공하는 계좌에 매월 $100 씩 납입하고 있습니다. 연이율 5%을 월이율로 변환하면 0.05/12 = 0.00417 가 됩니다. 한달이 지난 후에 계좌의 잔액은 다음과 같습니다. 

Suppose you save $100 each month into a savings account with the annual interest rate 5%. Thus, the monthly interest rate is 0.05/12 = 0.00417. After the first month, the value in the account becomes 

100 * (1 + 0.00417) = 100.417 

두달이 지난 후에 계좌의 잔액은 다음과 같습니다. 

After the second month, the value in the account becomes 

(100 + 100.417) * (1 + 0.00417) = 201.252 

세달이 지난 후에 계좌의 잔액은 다음과 같습니다. 

After the third month, the value in the account becomes 

(100 + 201.252) * (1 + 0.00417) = 302.507 and so on. 

매달 납입하는 금액을 입력으로 받아 여섯달이 지난후에 계좌의 잔액이 얼마나 되는지 계산하는 프로그램을 작성하세요.

Write a program that prompts the user to enter a monthly saving amount and displays the account value after the sixth month.

 

Input

* Line 1 : 매달 입금하는 금액을 나타내는 정수 (1~1,000)

 

Output

* Line 1 : 6달 후에 금액을 나타내는 실수 (소수점 첫째자리 아래는 버림, 예: 11.213의 경우 11.2로 출력, 11.0의 경우 11.0로 출력)

 

Sample Input
100
Sample Output
608.8
Hint

소수점 한자리까지 출력 System.out.printf("%.1f\n", 0.6789);

Source

JAVA2015 PE2.13