Question

C# Create an application that will allow a loan amount, interest rate, and number of finance...

C# Create an application that will allow a loan amount, interest rate, and number of finance years to be entered for a given loan.

Determine the monthly payment amount. Calculate how much interest will be paid over the life of the loan. Display an amortization schedule showing the new balance after each payment is made.

Design an object-oriented solution.

Use two classes. Loan class: characteristics such as the amount to be financed, rate of interest, period of time for the loan, and total interest paid will identify the current state of a loan object. Include methods to determine the monthly payment amount, return the total interest paid over the life of the loan, and Loantable function to display an amortization schedule that include: number of the cycle, payment amount, principal paid, interest paid, total interest paid, balance

LoanTest class: In the main class: instantiate an object of the loan class. Allow the user to input data about the loan. Then use Loantable function to display the Loan information.

Monthly Payment Formula: get monthly payment A from Loan Amount P, Interest Rate i, and Loan Period n.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

class Loan
{
// class variables declared
public decimal numberFinanceYears { get; set; }
public double InterestRate { get; set; }
public double LoanAmount { get; set; }
  
   // method to calculate monthly payment
public decimal CalculateMonthlyPayment()
{
decimal payment = 0;

if (numberFinanceYears > 0)
{
if (InterestRate != 0)
{
               // calculating payment
decimal rate = ((InterestRate / 12) / 100);
decimal factor = (rate + (rate / (Math.Pow(rate + 1, numberFinanceYears*12) - 1)));
payment = (LoanAmount * factor);
}
           else payment = (LoanAmount / (decimal)numberFinanceYears*12);
}
       LoanAmount = LoanAmount - payment/factor; // decreasing total loan amount per month
return Math.Round(payment, 2);
}
}



class LoanTest
{
   void Main()
   {
       // Creating loan object
       Loan loan = new Loan();
       loan.numberFinanceYears = 5;
       loan.InterestRate = 6.0;
       loan.LoanAmount = 100000;
       int count = 1;
      
       // breaking condition
       while(numberFinanceYears*12 < count)
       {
           printLoanInformation(loan, count);
           count++;
       }
   }

   // Printing monthly payment data
   void printLoanInformation(Loan loan, int month)
   {
       Console.WriteLine("Installment: {0:C}", month);
       Console.WriteLine("Loan Amount: {0:C}", loan.LoanAmount);
       Console.WriteLine("Annual Interest Rate: {0}%", loan.InterestRate);
       Console.WriteLine("Term: {0} years)", loan.LoanTermYears);
       decimal Payment = loan.CalculatePayment();
       Console.WriteLine("Monthly Payment: {0:C}", Payment);
       Console.WriteLine();
   }

}

Add a comment
Know the answer?
Add Answer to:
C# Create an application that will allow a loan amount, interest rate, and number of finance...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Requiremeht1 Complete the data table DATA Loan Amount Interest Rate Periods 35,000 6% Requirement 2 Using...

    Requiremeht1 Complete the data table DATA Loan Amount Interest Rate Periods 35,000 6% Requirement 2 Using the present value of an ordinary annuity table, calculate the payment amount and complete the amortization schedule Use the effective interest amortization method. a. Calculate the loan payment by dividing the loan amount by the appropriate present value factor b. Round values to two decimal places. Calculate the interest expense in the third year as the loan payment minus the loan balance at the...

  • Mortgage Amortization Complete the loan amortization schedule for a Mortgage that will be repaid over 360...

    Mortgage Amortization Complete the loan amortization schedule for a Mortgage that will be repaid over 360 months and answer the following questions (The details about the loan are shown below): Correct Answers 1. What is your monthly payment? 2. What is the total $ amount of payments made over the life of the loan Enter Answers Here. 3. How many months will it take to pay off the loan if you pay an extra $465.71 per month? Note: Enter the...

  • Create an amortization schedule for a 20-year, $200,000 loan at 7.5% interest with monthly payments. During...

    Create an amortization schedule for a 20-year, $200,000 loan at 7.5% interest with monthly payments. During which payment number does the amount applied to the principal exceed the amount paid to interest? True or False? After half of the time has passed in making payments, we also note that exactly half of the overall balance has been paid off. Explain. After completing the schedule, show two different ways for finding the total amount of interest paid over the 20 years.

  • Create an amortization schedule for a 20-year, $200,000 loan at 7.5% interest with monthly payments. During...

    Create an amortization schedule for a 20-year, $200,000 loan at 7.5% interest with monthly payments. During which payment number does the amount applied to the principal exceed the amount paid to interest? True or False? After half of the time has passed in making payments, we also note that exactly half of the overall balance has been paid off. Explain. After completing the schedule, show two different ways for finding the total amount of interest paid over the 20 years.

  • Prepare an amortization schedule for a three-year loan of $100,000. The interest rate is 8% per...

    Prepare an amortization schedule for a three-year loan of $100,000. The interest rate is 8% per year, and the loan calls for equal annual payment How much is the annual total loan payment? How much interest is paid in the first year? How much total interest is paid over the life of the loan?

  • Given the annual interest rate and a line of an amortization schedule for that loan, complete...

    Given the annual interest rate and a line of an amortization schedule for that loan, complete the next line of the schedule. Assume that payments are made monthly. Annual Interest Rate Payment $524.49 Interest Paid $43.29 Paid on Principal $481.20 Balance $8,040.03 out the amortization schedule below. Payment Balance Annual interest Rate 6.1% Interest Paid $43.29 Paid on Principal $481.20 $8.040.03 $524.49 $ 524.49 Round to the nearest cent as needed.

  • In C. Thank you! Bank Write a program to calculate the monthly payment on a loan...

    In C. Thank you! Bank Write a program to calculate the monthly payment on a loan given the loan amount, interest rate and the number of years to pay off the loan. Then add a function to print an amortization schedule for that loan. Create a class to save the current balance and the rest of the data as private data. Add member functions to make a payment and to print the amortization report. Use the following class header. Class...

  • Prepare an amortization schedule for a five-year loan of $38,000. The interest rate is 7% per...

    Prepare an amortization schedule for a five-year loan of $38,000. The interest rate is 7% per year, and the loan calls for equal annual payments. (Do not round intermediate calculations. Enter all amount as positive value. Round the final answers to 2 decimal places. Leave no cells blank - be certain to enter "0" wherever required.) Beginning Total Payment Interest Payment Principal Payment Ending Balance Year Balance Nm in How much interest is paid in the third year? (Do not...

  • repare an amortization schedule for a five-year loan of $45,000. The interest rate is 8% per...

    repare an amortization schedule for a five-year loan of $45,000. The interest rate is 8% per year, and the loan calls for equal annual payments. (Do not round intermediate calculations. Enter all amount as positive value. Round the final answers to 2 decimal places. Leave no cells blank - be certain to enter "0" wherever required.) Year Beginning Balance Total Payment Interest Payment Principal Payment Ending Balance 1 $ $ $ $ $ 2 3 4 5 How much interest...

  • Prepare an amortization schedule for a five-year loan of $33,000. The interest rate is 9% per...

    Prepare an amortization schedule for a five-year loan of $33,000. The interest rate is 9% per year, and the loan calls for equal annual payments. (Do not round intermediate calculations. Enter all amount as positive value. Round the final answers to 2 decimal places. Leave no cells blank - be certain to enter "0" wherever required.) Beginning Balance $ Total Payment $ Interest Payment $ Principal Payment $ Year Ending Balance $ 2 3 4 5 How much interest is...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT