Answer to Question #329610 in C# for Princess

Question #329610

The software shall calculate the monthly home loan repayment for buying a property



based on the values that the user entered. (See



https://www.sivavula.com/read/maths/grade-10/finance-and-growth/09-finance-and



growth-03 for more information on how to calculate this).



6.



If the monthly home loan repayment is more than a third of the user's gross monthly income, the software shall alert the user that approval of the home loan is unlikely.



7.



The software shall calculate the available monthly money after all the specified deductions



I have been made.



8.



The software shall not persist the user data between runs. The data shall only be stored in



memory while the software is running.

1
Expert's answer
2022-04-17T11:03:38-0400
internal class Program
{
    static void Main()
    {
        Console.Write("Enter gross monthly income: ");
        double grossMonthly = double.Parse(Console.ReadLine());


        Console.Write("Enter the principal loan amount: ");
        double loanAmount = double.Parse(Console.ReadLine());


        Console.Write("Enter monthly interest rate: ");
        double rate = double.Parse(Console.ReadLine());


        Console.Write("Enter of payments over the loan’s lifetime");
        double n = double.Parse(Console.ReadLine());


        double monthlyPayment = loanAmount * (rate * Math.Pow(1 + rate, n) / (Math.Pow(1 + rate, n) - 1));
        if (monthlyPayment > grossMonthly / 3)
            Console.WriteLine("Approval of the home loan is unlikely.");


        Console.WriteLine($"Available money after payment: {grossMonthly-monthlyPayment}");
        Console.ReadKey();
    }


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS