월복리

sanholee63 Reply 7 years 9 weeks ago
import java.util.Scanner; public class Main{ public static void main(String[] args){ double sum=0; Scanner keyboard=new Scanner(System.in); int Price=keyboard.nextInt(); while(Price>1000||Price<1){ Price=keyboard.nextInt(); } sum=Price*1.00417; double Sum=sum+100; for(int i=0;i<5;i++){ Sum*=(1.00417); Sum+=100; } Sum= (Math.floor(Sum*10)/10); System.out.printf("%.1f", Sum); } } 뭐가 틀린건가요? 값이 비슷하게만 나오고 안나와요
sanholee63 Reply 7 years 9 weeks ago
withcs1 Reply 7 years 8 weeks ago
식을 잘못세우셨어요 문제의 식 (100 + 100.417) * (1 + 0.00417) = 201.252 은 (입금금액 + 계좌금액) * (1 + 월이율) 입니다.