static void Main (string[] args)
{
while (true)//is mainly the use of formulas and if else nesting
{
String A, B = "";
Double C, D, e,s,q;
Double m = 6.55/100/12; Double n = 4.05/100/12;
int x;
Console.WriteLine ("Please select the type of mortgage (commercial loan or Provident Fund loan):");
A = Console.ReadLine ();
if (A = = "commercial loan")
{
Console.WriteLine ("Please enter loan amount (yuan):");
c = convert.todouble (Console.ReadLine ());
Console.WriteLine ("Please enter the loan term (month):");
D = convert.todouble (Console.ReadLine ());
Q = C/D;
Console.WriteLine ("Please enter the repayment method (equal principal or equal):");
b = Console.ReadLine ();
if (b = = "equal principal")
{
Console.WriteLine ("Your period is (the first few months after the loan):");
x = Convert.ToInt32 (Console.ReadLine ());
s = (d + 1) * c * (M/2);
E = C/D + (c-(x-1) * q) * m;
Console.WriteLine ("Your repayment amount for this month is" + E + "Yuan");
Console.WriteLine ("Your interest this month is" + (e-q) + "Yuan");
Console.WriteLine ("Your interest sum is" + S + "Yuan");
Console.WriteLine ("Your Benli sum is" + (S + C) + "Yuan");
Console.WriteLine ("Your month of the month for" + e+ "Yuan");
Console.WriteLine ("Your total amount of return is" E1+e2+......ex + "Yuan");
Console.WriteLine ("Your period is" + x);
Console.WriteLine ("You repay the principal and interest for this month is" + E + "Yuan");
Console.WriteLine ("You pay interest for this month is" + (e-q) + "Yuan");
Console.WriteLine ("The principal you have repaid so far is" + (x * q) + "Yuan");
Console.WriteLine ("The principal you have not repaid so far is" + (C-x * q) + "Yuan");
if (x = = 1)
{
Console.WriteLine ("This month is your highest monthly month");
}
Else
{
Console.WriteLine ("This month is not your maximum monthly month");
}
}
else if (b = = "equal principal and interest")
{
Console.Write ("Pending");
}
Else
{
Console.WriteLine ("Please enter the correct repayment method:");
}
}
if (A = = "CPF Loan")
{
Console.WriteLine ("Please enter loan amount (yuan):");
c = convert.todouble (Console.ReadLine ());
Console.WriteLine ("Please enter the loan term (month):");
D = convert.todouble (Console.ReadLine ());
Q = C/D;
Console.WriteLine ("Please enter the repayment method (equal principal or equal):");
b = Console.ReadLine ();
if (b = = "equal principal")
{
Console.WriteLine ("Your period is (the first few months after the loan):");
x = Convert.ToInt32 (Console.ReadLine ());
s = (d + 1) * c * (M/2);
E = C/D + (c-(x-1) * q) * n;
Console.WriteLine ("Your repayment amount for this month is" + E + "Yuan");
Console.WriteLine ("Your interest this month is" + (e-q) + "Yuan");
Console.WriteLine ("Your total amount of return is" E1+e2+......ex + "Yuan");
Console.WriteLine ("Your Interest sum is" +s + "Yuan");
Console.WriteLine ("Your Benli sum is" + (s+c) + "Yuan");
Console.WriteLine ("Your Month for" + e+ ");
Console.WriteLine ("Your period is" + x);
Console.WriteLine ("You repay the principal and interest for this month is" + e+ ");
Console.WriteLine ("You pay interest for this month is" + (e-q) + "Yuan");
Console.WriteLine ("The principal you have repaid so far is" + (x * q) + "Yuan");
Console.WriteLine ("The principal you have not repaid so far is" + (C-x * q) + "Yuan");
if (x = = 1)
{
Console.WriteLine ("This month is your highest monthly month");
}
Else
{
Console.WriteLine ("This month is not your maximum monthly month");
}
}
else if (b = = "equal principal and interest")
{
Console.Write ("Pending");
}
Else
{
Console.WriteLine ("Please enter the correct repayment method:");
}
}
Console.ReadLine ();
}
Use if else to find a mortgage