(本文公式有更正在底部)
公教 定期儲蓄存款 半年給息 利率1.595%
附件為細算公式 至少問了六位行員
如果不說 你一定不知道Trick在那裡
那一家的我不想說了
最後得知 它是單利 同時 以int(integer整數去除小數點) 來算
你可以心算出第一年前兩個月是 0
無言...........................
公教人員 你們辛苦了
台北富邦數位客服:
定存利息的計算方法,採按日計息
一、算式:本金X年利率/365天*存款天數,
故每月給息者,金額可能因月份天數不同有些微差異
注意它是 [按日計息]
由於沒有註明是四捨五入 所以我一概去除小數點
10000*1.595%/365*1 = 0.43698630137 第1天 利息是 0
10000*1.595%/365*1 = 0.43698630137 第2天 利息是 0
第一個月 利息 0
////////////////////////////細算公式///////////////
Result0: 858 第一年利
Result1: 2801 第二年利
Result2: 4760 第三年利
將code start 到 code end 放入此站 然後點網站中第一列的Run看結果
https://www.onlinegdb.com/online_c++_compiler
如圖
https://www.mediafire.com/view/yvgqp550i4017zx/bank_interest.png/file
//code start
#include <iostream>
#include <stdio.h>
int main()
{
double half_interest0;
double half_interest1;
double accumulation = 0.0;
accumulation += ((int)(10000 * 1.595 / 100 / 365)) * 31;
accumulation += ((int)(20000 * 1.595 / 100 / 365)) * 28;
accumulation += ((int)(30000 * 1.595 / 100 / 365)) * 31;
accumulation += ((int)(40000 * 1.595 / 100 / 365)) * 30;
accumulation += ((int)(50000 * 1.595 / 100 / 365)) * 31;
accumulation += ((int)(60000 * 1.595 / 100 / 365)) * 20;
half_interest0 = accumulation;
accumulation = 0.0;
accumulation += ((int)((60000 + half_interest0) * 1.595 / 100 / 365)) * 10;
//6/21 pay interest
accumulation += ((int)((70000 + half_interest0) * 1.595 / 100 / 365)) * 31;
accumulation += ((int)((80000 + half_interest0) * 1.595 / 100 / 365)) * 31;
accumulation += ((int)((90000 + half_interest0) * 1.595 / 100 / 365)) * 30;
accumulation += ((int)((100000 + half_interest0) * 1.595 / 100 / 365)) * 31;
accumulation += ((int)((110000 + half_interest0) * 1.595 / 100 / 365)) * 30;
accumulation += ((int)((120000 + half_interest0) * 1.595 / 100 / 365)) * 20;
half_interest1 = accumulation;
accumulation = 0.0;
accumulation += ((int)((120000 + half_interest0 + half_interest1) * 1.595 /
100 / 365)) * 11; //12/21 pay interest
std::cout << "Result0: " << half_interest0 + half_interest1 + accumulation <<
std::endl;
accumulation = 0.0;
accumulation += ((int)((120000 + 858 + 10000) * 1.595 / 100 / 365)) * 31;
accumulation += ((int)((120000 + 858 + 20000) * 1.595 / 100 / 365)) * 28;
accumulation += ((int)((120000 + 858 + 30000) * 1.595 / 100 / 365)) * 31;
accumulation += ((int)((120000 + 858 + 40000) * 1.595 / 100 / 365)) * 30;
accumulation += ((int)((120000 + 858 + 50000) * 1.595 / 100 / 365)) * 31;
accumulation += ((int)((120000 + 858 + 60000) * 1.595 / 100 / 365)) * 20;
half_interest0 = accumulation;
accumulation = 0.0;
accumulation += ((int)((120000 + 858 + 60000 + half_interest0) * 1.595 / 100
/ 365)) * 10; //6/21 pay interest
accumulation += ((int)((120000 + 858 + 70000 + half_interest0) * 1.595 / 100
/ 365)) * 31;
accumulation += ((int)((120000 + 858 + 80000 + half_interest0) * 1.595 / 100
/ 365)) * 31;
accumulation += ((int)((120000 + 858 + 90000 + half_interest0) * 1.595 / 100
/ 365)) * 30;
accumulation += ((int)((120000 + 858 + 100000 + half_interest0) * 1.595 / 100
/ 365)) * 31;
accumulation += ((int)((120000 + 858 + 110000 + half_interest0) * 1.595 / 100
/ 365)) * 30;
accumulation += ((int)((120000 + 858 + 120000 + half_interest0) * 1.595 / 100
/ 365)) * 20;
half_interest1 = accumulation;
accumulation = 0.0;
accumulation += ((int)((120000 + 858 + 120000 + half_interest0 +
half_interest1) * 1.595 / 100 / 365)) * 11; //12/21 pay interes
std::cout << "Result1: " << half_interest0 + half_interest1 + accumulation <<
std::endl;
accumulation = 0.0;
accumulation += ((int)((240000 + 2801 + 10000) * 1.595 / 100 / 365)) * 31;
accumulation += ((int)((240000 + 2801 + 20000) * 1.595 / 100 / 365)) * 28;
accumulation += ((int)((240000 + 2801 + 30000) * 1.595 / 100 / 365)) * 31;
accumulation += ((int)((240000 + 2801 + 40000) * 1.595 / 100 / 365)) * 30;
accumulation += ((int)((240000 + 2801 + 50000) * 1.595 / 100 / 365)) * 31;
accumulation += ((int)((240000 + 2801 + 60000) * 1.595 / 100 / 365)) * 20;
half_interest0 = accumulation;
accumulation = 0.0;
accumulation += ((int)((240000 + 2801 + 60000 + half_interest0) * 1.595 / 100
/ 365)) * 10; //6/21 pay interest
accumulation += ((int)((240000 + 2801 + 70000 + half_interest0) * 1.595 / 100
/ 365)) * 31;
accumulation += ((int)((240000 + 2801 + 80000 + half_interest0) * 1.595 / 100
/ 365)) * 31;
accumulation += ((int)((240000 + 2801 + 90000 + half_interest0) * 1.595 / 100
/ 365)) * 30;
accumulation += ((int)((240000 + 2801 + 100000 + half_interest0) * 1.595 /
100 / 365)) * 31;
accumulation += ((int)((240000 + 2801 + 110000 + half_interest0) * 1.595 /
100 / 365)) * 30;
accumulation += ((int)((240000 + 2801 + 120000 + half_interest0) * 1.595 /
100 / 365)) * 20;
half_interest1 = accumulation;
accumulation = 0.0;
accumulation += ((int)((240000 + 2801 + 120000 + half_interest0 +
half_interest1) * 1.595 / 100 / 365)) * 11; //12/21 pay interest
std::cout << "Result2: " << half_interest0 + half_interest1 + accumulation <<
std::endl << std::endl;
return 0;
}
//code end