Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace MorgageCalc
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             int loan, i_rate, period;
  15.  
  16.             double amount_after_t, i_amount;
  17.  
  18.             Console.WriteLine("Enter the desired amount of the loan: ");
  19.             loan = Convert.ToInt32(Console.ReadLine());
  20.  
  21.             Console.WriteLine("Enter the Interest Rate: ");
  22.             i_rate = Convert.ToInt32(Console.ReadLine());
  23.  
  24.             Console.WriteLine("Enter the Period of the loan (in years): ");
  25.             period = Convert.ToInt32(Console.ReadLine());
  26.  
  27.             i_amount = loan * i_rate / 100;
  28.  
  29.             Console.WriteLine("Your yearly Interest sum is: " + i_amount);
  30.  
  31.             amount_after_t = loan + (period * i_amount);
  32.  
  33.             Console.WriteLine("The total sum of the loan is: " + amount_after_t);
  34.             Console.WriteLine("The sum per month is: " + (amount_after_t/period)/12);
  35.  
  36.             Console.ReadLine();
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement