double epfTotal = 118395.17;
int yearsToRetire = 60 - age;
for (int i = 0; i <= yearsToRetire; i++)
Console.WriteLine(string.Format("Year: {0} . Age: {1}", year, age));
income_s = calcYearlyIncrement(income_f);
double epf_f = calcMonthlyEpf(income_f) * 6;
double epf_s = calcMonthlyEpf(income_s) * 6;
epfTotal = calcGovEpf(epfTotal + epf_f + epf_s);
Console.WriteLine(string.Format("Income 1st Half : RM{0:N2} . Income 2nd Half: RM{1:N2}", income_f, income_s));
Console.WriteLine(string.Format("EPF 1st Half : RM{0:N2} . EPF 2nd Half: RM{1:N2}", epf_f, epf_s));
Console.WriteLine(string.Format("EPF total: RM{0:N2}", epfTotal));
public double calcYearlyIncrement(double income)
return (income * 0.02) + income;
public double calcMonthlyEpf(double income)
return (income * 0.11) + (income * 0.16);
public double calcGovEpf(double epfTotal)
return (epfTotal * 0.0535) + epfTotal;