Create an application that will allow a loan amount, interest rate, and number o
ID: 3736951 • Letter: C
Question
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. Intorest Rate i, and Loan Period nExplanation / Answer
Solution:
code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace loanCalculator
{
class Program
{
static void Main(string[] args)
{
int balanceNew, theAmountOfLoan ;
int rateOfIntrest, monthltInstallments;
int years,totinter=0,newinter;
Console.WriteLine("Enter the amount of loan: ");
theAmountOfLoan = Int32.Parse(Console.ReadLine());
Console.WriteLine("Enter the interest rate on your loan %: ");
rateOfIntrest = Int32.Parse(Console.ReadLine());
Console.WriteLine("The number of years: ");
years = Int32.Parse(Console.ReadLine());
Console.WriteLine("What is your monthly intallments: ");
monthltInstallments = Int32.Parse(Console.ReadLine());
int i;
Console.WriteLine("Principle paid" + " " + "New Interest "+ "Total Interest " + " " + "Balance");
while(theAmountOfLoan>1)
{
Console.Write( monthltInstallments);
newinter = theAmountOfLoan * rateOfIntrest / 100;
Console.Write(" " + newinter);
totinter = totinter +newinter;
Console.Write(" " + totinter);
balanceNew = theAmountOfLoan - (newinter + monthltInstallments);
Console.Write(" " + balanceNew);
theAmountOfLoan = balanceNew;
Console.WriteLine(" ");
}
Console.ReadKey();
}
}
}
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.