Use if else to find a mortgage

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.