using System;
using System.IO;
class Program
{
public static void Main(string[] args)
{
CHKNM nmm = new CHKNM();
nmm.RUNNING();
}
}
class CHKNM
{
int[] BGN_RATR_DT = new int[]
{
20211115,
20220515,
20221115,
20230515,
20231115,
};
int[] END_RATR_DT = new int[]
{
20220514,
20221114,
20230514,
20231114,
20241231,
};
double[] RATE_INFO_VALUE = new double[]
{
0.0346,
0.0402,
0.0507,
0.0586,
0.0612,
};
double GET_RATEINFO(int days)
{
double rc = 0;
for(int ii=0; ii<BGN_RATR_DT.Length; ii++)
{
if(days >= BGN_RATR_DT[ii] && days <= END_RATR_DT[ii])
{
rc = RATE_INFO_VALUE[ii];
break;
}
}
return rc;
}
public void RUNNING()
{
int days = 0;
double MIDDLE = 0;
double FEE_DAY = 0;
double FEE_SUM = 0;
double RATEINFO = 0;
string manualDT = "20211115120000";
DateTime now = DateTime.ParseExact(manualDT, "yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture);
DateTime calcnow;
while(true)
{
calcnow = now.AddDays(days);
if(calcnow.ToString("yyyyMMdd") == "20211115") MIDDLE += 66048000;
if(calcnow.ToString("yyyyMMdd") == "20220415") MIDDLE += 66048000;
if(calcnow.ToString("yyyyMMdd") == "20220915") MIDDLE += 66048000;
if(calcnow.ToString("yyyyMMdd") == "20230215") MIDDLE += 66048000;
if(calcnow.ToString("yyyyMMdd") == "20230715") MIDDLE += 66048000;
if(calcnow.ToString("yyyyMMdd") == "20231215") MIDDLE += 60000000;
RATEINFO = GET_RATEINFO(Convert.ToInt32(calcnow.ToString("yyyyMMdd")));
FEE_DAY = MIDDLE * RATEINFO / 365.0;
FEE_SUM += FEE_DAY;
Console.WriteLine(calcnow.ToString("yyyyMMdd") + " " + MIDDLE.ToString() + " " + RATEINFO.ToString("000.0000") + " " +
FEE_DAY.ToString("000000000.000") + " " + FEE_SUM.ToString("000000000.000"));
if(calcnow.ToString("yyyyMMdd") == "20240701") break;
days++;
}
}
}
'c# 언어 > 초급과정' 카테고리의 다른 글
Windows Form 실행시에 Message 순서출력 (0) | 2024.01.06 |
---|---|
공백여러개를 하나로 정리하기 (0) | 2023.12.13 |
List<string> AuthorList = new List<string>();/control_datagridview.Rows.AddItem(AuthorList.ToArray()); (0) | 2023.10.11 |
now = DateTime.ParseExact(manualDT, "yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture); (0) | 2023.09.06 |
람다식 문법 : (입력 파라미터) => { 실행문장 블럭 }; (0) | 2023.06.12 |