Re: [請益] 公教優惠儲蓄的問題

作者: fatalfeel2 (風在動)   2023-10-29 13:03:09
整存整付細算每月 年本利和
請先參考這篇修正過的
https://www.ptt.cc/bbs/Bank_Service/M.1698566305.A.A4E.html
本程式使用他行 1.645% 固定利率
//copy paste to https://www.onlinegdb.com/online_c++_compiler and press run
#include <iostream>
#include <stdio.h>
#include <math.h>
int main()
{
double accumulation; //每月利息
double principal_interest = 10000.0; //本利和初始值 1 萬
//連算3年
for (int i = 0; i<3; i++)
{
//每日利息並取小數點第五位
//round(principal_interest * 1.645 / 100 / 365 * 100000.0) / 100000.0
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 31;
principal_interest += accumulation; //當月分的本利和
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 28;
principal_interest += accumulation;
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 31;
principal_interest += accumulation;
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 30;
principal_interest += accumulation;
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 31;
principal_interest += accumulation;
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 30;
principal_interest += accumulation;
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 31;
principal_interest += accumulation;
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 31;
principal_interest += accumulation;
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 30;
principal_interest += accumulation;
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 31;
principal_interest += accumulation;
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 30;
principal_interest += accumulation;
accumulation = round(principal_interest * 1.645 / 100 / 365 * 100000.0)
/ 100000.0 * 31;
principal_interest += accumulation;
//顯示當年結果
printf("principal_interest: %f\n", principal_interest);
}
getchar(); //等待enter鍵結束
return true; //返回成功碼 1
}
//第1年 10165.745630
//第2年 10334.238280
//第3年 10505.524190
各自細算自己的利息吧
※ 引述《fatalfeel2 (風在動)》之銘言:
: 請先參考這篇
: https://www.fubon.com/banking/document/news/TW/deposit_interest.pdf
: 每日利息之計算方式如下:1,000,000 元*0.8%*1/365 =21.9178081
: 元,四捨五入至小數點第五位後每日利息相當於 21.91781 元。假設計息期間首月 31 日
: 、次月 28 日,則該 2 個月之利息分別為:
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 101.138.46.112 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/PublicServan/M.1698555790.A.7DD.html
作者: pointa (偌痕~*)   2023-10-29 14:49:00
這串到底跟公職人員有什麼關係?還是業代在推薦儲蓄險?
作者: ibanez193 (加油阿~)   2023-10-29 15:14:00
檢核自己應有的保障有錯嗎?
作者: Dheroblood (神手1號)   2023-10-29 18:35:00
第一次聽到有人公開算法被說業代的……
作者: TSJTSJ (newhome)   2023-10-30 03:46:00
笑死 討論算法也能被說是業代

Links booklink

Contact Us: admin [ a t ] ucptt.com