<?xml version="1.0"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Calculate a Monthly Payment on a Loan</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Calculates the monthly payment on a loan.</Description>
      <Shortcut>mathPayLoan</Shortcut>
    </Header>
    <Snippet>
      <Imports>
        <Import>
          <Namespace>System</Namespace>
        </Import>
        <Import>
          <Namespace>Microsoft.VisualBasic</Namespace>
        </Import>
      </Imports>
      <Declarations>
        <Literal>
          <ID>annualInterestRate</ID>
          <Type>Double</Type>
          <ToolTip>Replace with a Double for the annual interest rate (e.g. 0.05 for 5%).</ToolTip>
          <Default>.05</Default>
        </Literal>
        <Literal>
          <ID>numberOfPayments</ID>
          <Type>Double</Type>
          <ToolTip>Replace with code that returns a Double for the total number of monthly payments.</ToolTip>
          <Default>36</Default>
        </Literal>
        <Literal>
          <ID>loanAmount</ID>
          <Type>Double</Type>
          <ToolTip>Replace with code that returns a Double for the loan amount.</ToolTip>
          <Default>1000</Default>
        </Literal>
      </Declarations>
      <Code Language="VB" Kind="method body"><![CDATA[Dim futureValue As Double = 0
Dim payment As Double
payment = Pmt($annualInterestRate$ / 12, $numberOfPayments$, -$loanAmount$, futureValue, DueDate.EndOfPeriod)]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>